https://medium.com/homullus/vuejs-dev-serve-with-reverse-proxy-cdc3c9756aeb
https://github.com/markomitranic/Kaputt-app/blob/master/Docker/nginx/conf/kaputt-dev.conf
server {
server_name kaputtweather.com;
listen *:80;
listen [::]:80;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
error_log stderr debug;
access_log /dev/stdout;
root /app/nada/public;
index index.html;
location / {
proxy_pass http://kaputt_node:8080/;
proxy_set_header Host localhost;
proxy_set_header Origin localhost;
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin "http://kaputtweather.com";
}
location /sockjs-node/ {
proxy_pass http://kaputt_node:8080;
proxy_set_header Host localhost;
proxy_set_header Origin localhost;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin "http://kaputtweather.com";
}
location /api/ {
proxy_pass http://localhost:8081/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
proxy_connect_timeout 90s;
proxy_read_timeout 90s;
proxy_send_timeout 90s;
}
}