Skip to content

Instantly share code, notes, and snippets.

@Cleberw3b
Last active November 20, 2019 22:35
Show Gist options
  • Save Cleberw3b/7ff9dc3a0a2f23529f383c98f262b9a7 to your computer and use it in GitHub Desktop.
Save Cleberw3b/7ff9dc3a0a2f23529f383c98f262b9a7 to your computer and use it in GitHub Desktop.
nginx configuration for nossovoto
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