You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3 KiB

4 years ago
upstream factory_servers {
4 years ago
#ip_hash;
server 127.0.0.1:3000;
#server readmongo:3000;
4 years ago
keepalive 64;
#ip_hash;
4 years ago
}
proxy_cache_path /var/tmp levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m use_temp_path=off;
4 years ago
resolver_timeout 5s;
4 years ago
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name factory.swarmlab.io;
return 301 https://factory.swarmlab.io$request_uri;
}
server {
listen [::]:443 ssl ipv6only=off;
server_name factory.swarmlab.io;
# To allow special characters in headers
ignore_invalid_headers off;
# Allow any size file to be uploaded.
# Set to a value such as 1000m; to restrict file size to a specific value
client_max_body_size 0;
# To disable buffering
proxy_buffering off;
ssl_certificate /etc/nginx/fullchain.pem;
ssl_certificate_key /etc/nginx/key.private.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
# # Requests for socket.io are passed on to Node on port 3000
# location ~* \.io {
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-NginX-Proxy false;
#
# proxy_pass http://factory_servers;
# proxy_redirect off;
#
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# }
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy false;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
4 years ago
#set $originaddr http://factory_servers;
4 years ago
#proxy_pass $originaddr;
4 years ago
# or even
4 years ago
# proxy_pass http://origin.example.com$request_uri;
4 years ago
4 years ago
proxy_pass http://factory_servers$request_uri;
4 years ago
4 years ago
# proxy_pass http://factory_servers;
# proxy_pass http://$host;
4 years ago
proxy_redirect off;
proxy_read_timeout 240s;
}
}