worker_processes 1; events { worker_connections 1024; } http { sendfile on; client_max_body_size 64m; #client_body_temp_path /data/temp; server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html index.htm; include /etc/nginx/mime.types; gzip on; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; sendfile on; client_max_body_size 64m; location / { try_files $uri $uri/ /index.html; } # https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite location /backend-api/ { #rewrite ^/backend-api(.*) /$1 break; proxy_pass http://phoenix-system:3000/; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /admin-api { proxy_pass http://phoenix-system:3000/admin-api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /remote-assets { proxy_pass http://phoenix-system:3000/remote-assets; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /sti { proxy_pass http://phoenix-system:3000/sti; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /ws { proxy_pass http://phoenix-system:3000/graphql; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { # This new server will watch for traffic on 443 listen 443 ssl http2; server_name localhost; ssl_certificate /etc/nginx/external-certificate/certificate.crt; ssl_certificate_key /etc/nginx/external-certificate/certificate.key; root /usr/share/nginx/html; index index.html index.htm; include /etc/nginx/mime.types; gzip on; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; sendfile on; client_max_body_size 64m; location / { try_files $uri $uri/ /index.html; } # https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite location /backend-api/ { #rewrite ^/backend-api(.*) /$1 break; proxy_pass http://phoenix-system:3000/; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto https; } location /admin-api { proxy_pass http://phoenix-system:3000/admin-api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /remote-assets { proxy_pass http://phoenix-system:3000/remote-assets; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto https; } location /sti { proxy_pass http://phoenix-system:3000/sti; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } location /ws { proxy_pass http://phoenix-system:3000/graphql; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } }