Last active
October 25, 2018 02:50
-
-
Save hotsoupisgood/78ad862cbfba5daa4d44b85805f93bd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html; | |
# Add index.php to the list if you are using PHP | |
index index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
} | |
server { | |
root /var/www/html; | |
index index.html index.htm index.nginx-debian.html; | |
server_name lucashenry.xyz; # managed by Certbot | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
listen [::]:443 ssl ipv6only=on; # managed by Certbot | |
listen 443 ssl; # managed by Certbot | |
ssl_certificate /etc/letsencrypt/live/lucashenry.xyz/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/lucashenry.xyz/privkey.pem; # managed by Certbot | |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | |
} | |
server { | |
listen 80; | |
listen 443 ssl; | |
server_name server_name lucashenry.xyz; | |
ssl_certificate /etc/letsencrypt/live/lucashenry.xyz/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/lucashenry.xyz/privkey.pem; # managed by Certbot | |
location / { | |
proxy_pass http://172.26.14.69:8080; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} | |
server { | |
if ($host = lucashenry.xyz) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
listen 80 ; | |
listen [::]:80 ; | |
server_name lucashenry.xyz; | |
return 404; # managed by Certbot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment