factorio-server-manager/docker/nginx.conf
2018-01-21 14:45:00 -05:00

75 lines
2.0 KiB
Nginx Configuration File

user nginx;
worker_processes 1;
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;
upstream goapp {
server 127.0.0.1:8080;
}
server {
listen 80 default_server;
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;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
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 / {
root /opt/factorio-server-manager/app;
try_files $uri /index.html;
}
}
}