Last active
November 20, 2019 22:35
-
-
Save Cleberw3b/7ff9dc3a0a2f23529f383c98f262b9a7 to your computer and use it in GitHub Desktop.
nginx configuration for nossovoto
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
events { | |
} | |
http { | |
server { | |
root /var/www/html/app; | |
index index.html; | |
server_name app.nossovoto.com.br; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
listen [::]:443 default_server ssl ipv6only=on; | |
listen 443 ssl; | |
ssl_certificate /etc/letsencrypt/live/nossovoto.com.br/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/nossovoto.com.br/privkey.pem; | |
include /etc/letsencrypt/options-ssl-nginx.conf; | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | |
} | |
server { | |
root /var/www/html; | |
server_name www.nossovoto.com.br nossovoto.com.br; | |
location / { | |
# Zeit Now only | |
proxy_set_header host zeit.application.now.sh; | |
proxy_ssl_server_name on; | |
proxy_pass https://alias.zeit.co; | |
# Reverse Proxy | |
# proxy_pass http://localhost:3000; | |
# 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; | |
} | |
location /curadoria { | |
try_files $uri $uri/ /curadoria/index.html; | |
} | |
listen [::]:443; | |
listen 443; | |
ssl_certificate /etc/letsencrypt/live/nossovoto.com.br/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/nossovoto.com.br/privkey.pem; | |
include /etc/letsencrypt/options-ssl-nginx.conf; | |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | |
} | |
server { | |
if ($host = www.nossovoto.com.br) { | |
return 301 https://$host$request_uri; | |
} | |
if ($host = nossovoto.com.br) { | |
return 301 https://$host$request_uri; | |
} | |
if ($host = app.nossovoto.com.br) { | |
return 301 https://$host$request_uri; | |
} | |
listen 80; | |
listen [::]:80; | |
server_name app.nossovoto.com.br www.nossovoto.com.br nossovoto.com.br; | |
return 404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment