Skip to content

Instantly share code, notes, and snippets.

@Sanjay007
Created December 31, 2020 11:40
Show Gist options
  • Save Sanjay007/6491938b5c78a1db28c3ca158fdd0d4b to your computer and use it in GitHub Desktop.
Save Sanjay007/6491938b5c78a1db28c3ca158fdd0d4b to your computer and use it in GitHub Desktop.
Configure Free SSL Nginx , Centos 7 , Go Daddy Domain On VPS . Configure Nginx With Angular and NodeJS Backend
upstream notes{
server 178.37.152.51:3000;
}
upstream backapi{
server 187.37.152.51:8443;
}
#limit_req_zone $binary_remote_addr zone=one:50m rate=20r/s;
server {
listen 80;
listen [::]:80;
server_name xyz.com;
return 301 https://xyz.com$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name www.xyz.com;
return 301 https://xyz.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name xyz.com www.xyz.com;
# server_name xyz.com www.xyz.com;
location / {
proxy_set_header Host $http_host;
proxy_pass http://notes;
}
location /api/{
proxy_buffering off;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://backapi;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment