Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hasantayyar/b99ba505c9feaffd2b194034704025bc to your computer and use it in GitHub Desktop.
Save hasantayyar/b99ba505c9feaffd2b194034704025bc to your computer and use it in GitHub Desktop.
server {
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt;
allow all;
}
index index.html index.htm index.nginx-debian.html;
server_name xxxx.com www.xxxx.com;
location / {
allow 18.195.12.149;
deny all;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:4873;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxxxxxxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxxxxxxxx/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 {
if ($host = xxxxxx) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name xxxx.com www.xxxxx.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment