Skip to content

Instantly share code, notes, and snippets.

@ezirmusitua
Created January 9, 2019 06:41
Show Gist options
  • Save ezirmusitua/d0f35d8b621fa469c1aa646a8beb339b to your computer and use it in GitHub Desktop.
Save ezirmusitua/d0f35d8b621fa469c1aa646a8beb339b to your computer and use it in GitHub Desktop.
[Nginx proxy pass config] use nginx proxy pass (use letsencrypt cert & mantain with certbot) #deploy #nginx
## demo site
server {
listen 80;
listen [::]:80;
server_name <site_name>;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name api.ezirmusitua.site;
access_log /opt/sites/logs/<site_name>.access.log;
error_log /opt/sites/logs/<site_name>.error.log;
ssl_certificate /etc/letsencrypt/live/<site_name>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<site_name>/privkey.pem;
keepalive_timeout 120;
server_tokens off;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
location /quote-price {
proxy_pass http://localhost:3000; # proxy pass to
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment