Aggiorna README.md
This commit is contained in:
parent
6c03e48eec
commit
cae462687a
1 changed files with 23 additions and 1 deletions
22
README.md
22
README.md
|
|
@ -13,12 +13,34 @@ nginx è settato così
|
|||
ssl_certificate ssl/live/patachina.it/fullchain.pem;
|
||||
ssl_certificate_key ssl/live/patachina.it/privkey.pem;
|
||||
|
||||
# per aggancio con applicazione Flutter android
|
||||
location /.well-known/ {
|
||||
proxy_pass http://192.168.1.3:3400/.well-known/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
# Per farlo funzionare anche su Browser anche senza noCORS difatti abilita tutte le origini
|
||||
location /api/ {
|
||||
proxy_pass http://192.168.1.3:3400; # o il tuo backend
|
||||
|
||||
# Header CORS per tutte le richieste
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization' always;
|
||||
|
||||
# Gestione preflight OPTIONS
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header 'Access-Control-Max-Age' 86400;
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization' always;
|
||||
add_header 'Content-Length' 0;
|
||||
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
# per il passaggio dei dati
|
||||
location / {
|
||||
proxy_pass http://192.168.1.3:3400;
|
||||
proxy_set_header Host $host;
|
||||
|
|
|
|||
Loading…
Reference in a new issue