2020-04-15 19:17:06 +00:00
|
|
|
server {
|
2020-04-18 12:44:33 +00:00
|
|
|
listen 443 ssl http2;
|
|
|
|
server_name osp.server.tld;
|
|
|
|
|
|
|
|
#access_log /var/log/nginx/osp.server.tld.access.gz main buffer=16k gzip=9 flush=5m;
|
|
|
|
error_log /var/log/nginx/osp.server.tld.error;
|
|
|
|
|
|
|
|
charset utf-8;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_pass http://127.0.0.1:8585;
|
|
|
|
// Workaround for OSP bug: https://gitlab.com/Deamos/flask-nginx-rtmp-manager/-/issues/176
|
|
|
|
proxy_set_header Host $server_name;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
location /socket.io {
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
|
|
proxy_set_header X-NginX-Proxy true;
|
|
|
|
|
|
|
|
# prevents 502 bad gateway error
|
|
|
|
proxy_buffers 8 32k;
|
|
|
|
proxy_buffer_size 64k;
|
2020-04-15 19:17:06 +00:00
|
|
|
|
2020-04-18 12:44:33 +00:00
|
|
|
proxy_redirect off;
|
2020-04-15 19:17:06 +00:00
|
|
|
|
2020-04-18 12:44:33 +00:00
|
|
|
# enables WS support
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
2020-04-15 19:17:06 +00:00
|
|
|
|
2020-04-18 12:44:33 +00:00
|
|
|
proxy_pass http://127.0.0.1:8585/socket.io;
|
|
|
|
}
|
2020-04-15 19:17:06 +00:00
|
|
|
|
|
|
|
|
2020-04-18 12:44:33 +00:00
|
|
|
#include config/gzip.conf;
|
2020-04-15 19:17:06 +00:00
|
|
|
|
2020-04-18 12:44:33 +00:00
|
|
|
# Certificate config
|
|
|
|
#include ssl/server.tld.conf;
|
|
|
|
#include config/ssl.conf;
|
2020-04-15 19:17:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name osp.server.tld;
|
|
|
|
return 301 https://osp.server.tld$request_uri;
|
|
|
|
}
|