Skip to content

Instantly share code, notes, and snippets.

@jatrost
Last active October 22, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jatrost/428d3b8ef2a1a2b28062 to your computer and use it in GitHub Desktop.
Save jatrost/428d3b8ef2a1a2b28062 to your computer and use it in GitHub Desktop.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8443 ssl;
ssl_certificate /etc/ssl/private/mhn.yourcompany.com.pem;
ssl_certificate_key /etc/ssl/private/mhn.yourcompany.com.pem;
root /opt/honeymap/client;
index index.html index.htm;
server_name mhn.yourcompany.com;
location / {
try_files $uri $uri/ /index.html;
}
location /data/ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
server {
listen 80;
listen 443 ssl;
server_name mhn.yourcompany.com;
ssl_certificate /etc/ssl/private/mhn.yourcompany.com.pem;
ssl_certificate_key /etc/ssl/private/mhn.yourcompany.com.pem;
if ($ssl_protocol = "") {
rewrite ^ https://$host$request_uri? permanent;
}
location / {
try_files $uri @mhnserver;
}
root /opt/www;
location @mhnserver {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.sock;
}
location /static {
alias /opt/mhn/server/mhn/static;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment