Created
September 4, 2018 18:38
-
-
Save itsmunim/c50cfa3554a3e8e7355e4cf394db2db6 to your computer and use it in GitHub Desktop.
A simple nginx config to provide multiple frontends in different route; with ssl by letsencrypt
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 example.com www.example.com; | |
| listen [::]:443 ssl ipv6only=on; | |
| listen 443 ssl; | |
| ssl_certificate /your_cert_path/fullchain.pem; | |
| ssl_certificate_key /your_cert_path/privkey.pem; | |
| include /etc/letsencrypt/options-ssl-nginx.conf; | |
| ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; | |
| location / { | |
| try_files $uri $uri/ =404; | |
| } | |
| location /portfolio/ { | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $remote_addr; | |
| proxy_set_header Host $host; | |
| proxy_pass http://127.0.0.1:8080; | |
| } | |
| location /blog/ { | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $remote_addr; | |
| proxy_set_header Host $host; | |
| proxy_pass http://127.0.0.1:1337; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment