diff --git a/client/nginx/default b/client/nginx/default new file mode 100644 index 0000000..88e12f7 --- /dev/null +++ b/client/nginx/default @@ -0,0 +1,37 @@ +server { + root /var/www/example.com/html; + index index.html; + + server_name example.com www.example.com; + + location / { + try_files $uri /index.html + } + + listen [::]:443 ssl ipv6only=on; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/texample.com/privkey.pem; + + location /server { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_pass http://localhost:8585; + } +} + +server { + if ($host = www.example.com) { + return 301 https://$host$request_uri; + } + if ($host = example.com) { + return 301 https://$host$request_uri; + } + + listen 80; + listen [::]:80; + + server_name example.com www.example.com; + return 404; +}