Advertisement
sugengdcahyo

Untitled

Apr 22nd, 2024
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | Source Code | 0 0
  1. server {
  2.     server_name robota.app;
  3.     access_log /var/log/robota.app_access.log;
  4.     error_log /var/log/robota.app_error.log;
  5.  
  6.     location / {
  7.         proxy_pass http://localhost:3000; # change this, add port if redirect to specifi port
  8.         proxy_buffering on;
  9.         proxy_buffers 12 12k;
  10.         proxy_redirect off;
  11.  
  12.         proxy_set_header X-Real-IP $remote_addr;
  13.         proxy_set_header X-Forwarded-For $remote_addr;
  14.         proxy_set_header Host $host;
  15.     }
  16.  
  17.  
  18.     gzip on;
  19.     gzip_types
  20.         text/css
  21.         text/javascript
  22.         text/xml
  23.         text/plain
  24.         application/javascript
  25.         application/x-javascript
  26.         application/json;
  27.  
  28.  
  29.  
  30.  
  31.     listen 443 ssl; # managed by Certbot
  32.     ssl_certificate /etc/letsencrypt/live/robota.app/fullchain.pem; # managed by Certbot
  33.     ssl_certificate_key /etc/letsencrypt/live/robota.app/privkey.pem; # managed by Certbot
  34.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  35.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  36.  
  37. }
  38. server {
  39.     if ($host = robota.app) {
  40.         return 301 https://$host$request_uri;
  41.     } # managed by Certbot
  42.  
  43.  
  44.     server_name robota.app;
  45.     listen 80;
  46.     return 404; # managed by Certbot
  47.  
  48.  
  49. }
Tags: nginx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement