Skip to content

Instantly share code, notes, and snippets.

@mikeyp mikeyp/nginx.conf
Created Jul 26, 2017

Embed
What would you like to do?
server {
listen [::]:6789;
listen 6789;
server_name unifi.shomeyabuild.space;
access_log /var/log/nginx/unifi-access.log;
error_log /var/log/nginx/unifi-error.log;
location / {
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
proxy_pass http://unifi-6789;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include /home/dokku/unifi/nginx.conf.d/*.conf;
}
server {
listen [::]:8080;
listen 8080;
server_name unifi.shomeyabuild.space;
access_log /var/log/nginx/unifi-access.log;
error_log /var/log/nginx/unifi-error.log;
location / {
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
proxy_pass http://unifi-8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include /home/dokku/unifi/nginx.conf.d/*.conf;
}
server {
listen [::]:80;
listen 80;
server_name unifi.shomeyabuild.space;
access_log /var/log/nginx/unifi-access.log;
error_log /var/log/nginx/unifi-error.log;
return 301 https://$host:$request_uri;
}
server {
listen [::]:443 ssl ;
listen 443 ssl ;
server_name unifi.shomeyabuild.space;
server_name unifi.shomeyabuild.space;
access_log /var/log/nginx/unifi-access.log;
error_log /var/log/nginx/unifi-error.log;
ssl_certificate /home/dokku/unifi/tls/server.crt;
ssl_certificate_key /home/dokku/unifi/tls/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
keepalive_timeout 70;
location / {
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
proxy_pass http://unifi-8443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include /home/dokku/unifi/nginx.conf.d/*.conf;
}
upstream unifi-6789 {
server 172.17.0.12:6789;
}
upstream unifi-8080 {
server 172.17.0.12:8080;
}
upstream unifi-8443 {
server 172.17.0.12:8443;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.