-
-
Save farmdawgnation/d838c66816244aa64256 to your computer and use it in GitHub Desktop.
Depend On Nginx Config
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 443 ssl; | |
listen [::]:443 ssl; | |
ssl_certificate /etc/ssl/{{ dependon_hostname }}.crt; | |
ssl_certificate_key /etc/ssl/private/{{ dependon_hostname }}.key; | |
server_name {{ dependon_hostname }}; | |
{% if auth_realm is defined %} | |
auth_basic "{{ auth_realm }}"; | |
auth_basic_user_file /etc/nginx/dependon.htpasswd; | |
{% endif %} | |
add_header Strict-Transport-Security "max-age=31536000;"; | |
location / { | |
proxy_pass http://127.0.0.1:8080; | |
} | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name {{ dependon_hostname }}; | |
location / { | |
rewrite ^/(.*)$ https://{{ dependon_hostname }}/$1; | |
} | |
} | |
{%if www_redirect is defined %} | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name www.{{ dependon_hostname }}; | |
ssl_certificate /etc/ssl/{{ dependon_hostname }}.crt; | |
ssl_certificate_key /etc/ssl/private/{{ dependon_hostname }}.key; | |
add_header Strict-Transport-Security "max-age=31536000;"; | |
location / { | |
rewrite ^/(.*)$ https://{{ dependon_hostname }}/$1 permanent; | |
} | |
} | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.{{ dependon_hostname }}; | |
location / { | |
rewrite ^/(.*)$ https://{{ dependon_hostname }}/$1 permanent; | |
} | |
} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment