Advertisement
Guest User

asdfasdf

a guest
Aug 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 4.05 KB | None | 0 0
  1. upstream puma {
  2.     server unix://home/deploy/apps/pte_backend/shared/tmp/sockets/pte_backend-puma.sock fail_timeout=0;
  3. }
  4.  
  5. server {
  6.   server_name api.houseofenglish.online;
  7.  
  8.   root /home/deploy/apps/pte_backend/current/public;
  9.  
  10.   try_files $uri/index.html $uri @puma;
  11.  
  12.   location @puma {
  13.     proxy_pass http://puma;
  14.     proxy_set_header 'Access-Control-Allow-Origin' 'https://creator.houseofenglish.online';
  15.     proxy_set_header 'Access-Control-Allow-Origin' 'https://www.houseofenglish.online';
  16.     proxy_set_header 'Access-Control-Allow-Origin' 'https://houseofenglish.online';
  17.     proxy_set_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE, PATCH, HEAD';
  18.     proxy_set_header 'Access-Control-Allow-Headers' 'X-Requested-With,Accept,Content-Type, Origin';
  19.  
  20.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21.     proxy_set_header   X-Forwarded-Proto https;
  22.     proxy_set_header Host $http_host;
  23.     proxy_redirect off;
  24.   }
  25.  
  26.   error_page 500 502 503 504 /500.html;
  27.   client_max_body_size 4G;
  28.   keepalive_timeout 10;
  29.  
  30.  
  31.     listen 443 ssl; # managed by Certbot
  32.     ssl_certificate /etc/letsencrypt/live/houseofenglish.online/fullchain.pem; # managed by Certbot
  33.     ssl_certificate_key /etc/letsencrypt/live/houseofenglish.online/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.  
  39. server {
  40.   server_name creator.houseofenglish.online;
  41.   index index.html index.htm;
  42.   root /home/deploy/apps/pte_creator/current;
  43.   location / {
  44.     try_files $uri $uri/ /index.html;
  45.   }
  46.   location ~* \.html?$ {
  47.     expires -1;
  48.     add_header Pragma "no-cache";
  49.     add_header Cache-Control "no-store, must-revalidate";
  50.     }
  51.   error_page 404 /404.html;
  52.   error_page 500 502 503 504 /50x.html;
  53.   location = /50x.html {
  54.     root /usr/share/nginx/html;
  55.   }
  56.  
  57.  
  58.     listen 443 ssl; # managed by Certbot
  59.     ssl_certificate /etc/letsencrypt/live/houseofenglish.online/fullchain.pem; # managed by Certbot
  60.     ssl_certificate_key /etc/letsencrypt/live/houseofenglish.online/privkey.pem; # managed by Certbot
  61.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  62.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  63.  
  64. }
  65.  
  66. server {
  67.   server_name houseofenglish.online www.houseofenglish.online;
  68.   index index.html index.html;
  69.   root /home/deploy/apps/pte_app/current;
  70.  
  71.   location / {
  72.     try_files $uri $uri/ /index.html;
  73.   }
  74.   location ~* \.html?$ {
  75.     expires -1;
  76.         add_header Pragma "no-cache";
  77.     add_header Cache-Control "no-store, must-revalidate";
  78.   }
  79.   error_page 404 /404.html;
  80.   error_page 500 502 503 504 /50x.html;
  81.  
  82.   location = /50x.html {
  83.     root /usr/share/nginx/html;
  84.   }
  85.  
  86.     listen 443 ssl; # managed by Certbot
  87.     ssl_certificate /etc/letsencrypt/live/houseofenglish.online/fullchain.pem; # managed by Certbot
  88.     ssl_certificate_key /etc/letsencrypt/live/houseofenglish.online/privkey.pem; # managed by Certbot
  89.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  90.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  91.  
  92.  
  93. }
  94.  
  95.  
  96.  
  97. server {
  98.     if ($host = www.houseofenglish.online) {
  99.         return 301 https://$host$request_uri;
  100.     } # managed by Certbot
  101.  
  102.  
  103.     if ($host = houseofenglish.online) {
  104.         return 301 https://$host$request_uri;
  105.     } # managed by Certbot
  106.  
  107.  
  108.   server_name houseofenglish.online www.houseofenglish.online;
  109.  
  110.     listen 80;
  111.     return 404; # managed by Certbot
  112.  
  113.  
  114.  
  115.  
  116. }
  117.  
  118. server {
  119.     if ($host = api.houseofenglish.online) {
  120.         return 301 https://$host$request_uri;
  121.     } # managed by Certbot
  122.  
  123.  
  124.   server_name api.houseofenglish.online;
  125.  
  126.  
  127.     listen 80;
  128.     return 404; # managed by Certbot
  129.  
  130.  
  131. }
  132.  
  133. server {
  134.     if ($host = creator.houseofenglish.online) {
  135.         return 301 https://$host$request_uri;
  136.     } # managed by Certbot
  137.  
  138.  
  139.   server_name creator.houseofenglish.online;
  140.  
  141.     listen 80;
  142.     return 404; # managed by Certbot
  143.  
  144.  
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement