Created
December 4, 2020 23:06
-
-
Save Tymotex/f23a746727a26eff3c96132ce56d0038 to your computer and use it in GitHub Desktop.
Techsuite NGINX Configuration File
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 { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
root /home/tim/Techsuite/client/build; | |
index index.html; | |
server_name 128.199.207.32 techsuite.dev www.techsuite.dev; | |
# Frontend routes | |
location / { | |
include proxy_params; | |
#proxy_pass http://127.0.0.1:3000; | |
try_files $uri /index.html; | |
} | |
# Backend API namespace | |
location /api { | |
include proxy_params; | |
proxy_pass http://127.0.0.1:5000; | |
} | |
# Handling socket connections | |
location /socket.io { | |
include proxy_params; | |
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
proxy_pass http://127.0.0.1:5000/socket.io; | |
} | |
ssl_certificate /etc/letsencrypt/live/techsuite.dev/fullchain.pem; # managed by Certbot | |
ssl_certificate_key /etc/letsencrypt/live/techsuite.dev/privkey.pem; # managed by Certbot | |
} | |
# Redirecting HTTP connections to HTTPS | |
server { | |
listen 80; | |
server_name 128.199.207.32 techsuite.dev www.techsuite.dev; | |
if ($host = www.techsuite.dev) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
if ($host = techsuite.dev) { | |
return 301 https://$host$request_uri; | |
} # managed by Certbot | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment