75 lines
2.0 KiB
Nginx Configuration File
Raw Normal View History

user nginx;
worker_processes 1;
2016-09-27 18:32:16 -03:00
error_log logs/error.log warn;
pid run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
client_max_body_size 100m;
#gzip on;
2016-09-27 18:32:27 -03:00
upstream goapp {
2016-09-27 19:16:58 -03:00
server 127.0.0.1:8080;
2016-09-27 18:32:27 -03:00
}
server {
listen 80 default_server;
2017-04-10 18:52:47 -04:00
return 301 https://$host$request_uri;
}
server {
listen 443 default_server;
ssl on;
ssl_certificate /security/server.crt;
ssl_certificate_key /security/server.key;
ssl_session_timeout 5m;
2018-01-21 14:45:00 -05:00
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
2018-01-21 14:45:00 -05:00
location /ws {
proxy_pass http://goapp;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_redirect off;
}
location /api {
proxy_pass http://goapp;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
location / {
2017-04-10 18:52:47 -04:00
root /opt/factorio-server-manager/app;
2016-05-15 15:37:44 -04:00
try_files $uri /index.html;
}
}
}