Created
December 10, 2021 05:47
-
-
Save sajjad960/2dfe2ad6236fee1bc06a099a2dfa823a to your computer and use it in GitHub Desktop.
Site-available-config-nginx
This file contains hidden or 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 { | |
| server_name githubuser.findsajjad.com; | |
| root /usr/share/nginx/githubuser; | |
| index index.html; | |
| location / { | |
| # limit_req zone=MYZONE; | |
| try_files $uri /index.html; | |
| } | |
| listen 443 ssl; # managed by Certbot | |
| ssl_certificate /etc/letsencrypt/live/githubuser.findsajjad.com/fullchain.pem; # managed by Certbot | |
| ssl_certificate_key /etc/letsencrypt/live/githubuser.findsajjad.com/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 = githubuser.findsajjad.com) { | |
| return 301 https://$host$request_uri; | |
| } # managed by Certbot | |
| listen 80; | |
| server_name githubuser.findsajjad.com; | |
| return 404; # managed by Certbot | |
| } | |
| server { | |
| server_name www.githubuser.findsajjad.com; | |
| if ($host = www.githubuser.findsajjad.com) { | |
| return 301 https://githubuser.findsajjad.com$request_uri; | |
| } | |
| listen 443 ssl; # managed by Certbot | |
| ssl_certificate /etc/letsencrypt/live/www.githubuser.findsajjad.com/fullchain.pem; # managed by Certbot | |
| ssl_certificate_key /etc/letsencrypt/live/www.githubuser.findsajjad.com/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 { | |
| server_name www.githubuser.findsajjad.com; | |
| listen 80; | |
| return 404; # managed by Certbot | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment