Skip to content

Commit

Permalink
websocket & wildcard redirect (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmhta authored Aug 24, 2020
1 parent 5894acf commit 38aba4e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/nginx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ worker_connections 1024;
}

http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

include /etc/nginx/mime.types;
default_type application/octet-stream;

Expand Down Expand Up @@ -53,6 +58,9 @@ http {
proxy_pass http://localhost:{{port}};
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
{{/port}}
Expand All @@ -74,7 +82,7 @@ http {
alias {{letsencryptWwwDir}}/.well-known/acme-challenge;
}
location / {
return 301 https://$server_name$request_uri;
return 301 https://$host$request_uri;
}
}
server {
Expand All @@ -89,6 +97,9 @@ http {
proxy_pass http://localhost:{{port}};
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
{{/port}}
Expand Down

0 comments on commit 38aba4e

Please sign in to comment.