Advertisement
twentytwo7ths

NGINX - domain.com.conf

Jul 13th, 2019
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.31 KB | None | 0 0
  1. # https://serverfault.com/q/975135/92023
  2.  
  3. server {
  4.     listen 80;
  5.     server_name jira.domain.com;
  6.     return 301 https://$host$request_uri;
  7. }
  8. server {
  9.     listen 80;
  10.     server_name subdomain1.domain.com;
  11.     return 301 https://$host$request_uri;
  12. }
  13. server {
  14.     listen 80;
  15.     server_name subdomain2.domain.com;
  16.     return 301 https://$host$request_uri;
  17. }
  18. server {
  19.    listen 443 ssl;
  20.    server_name jira.domain.com;
  21.    server_tokens off;
  22.    location / {
  23.        proxy_set_header Host $server_name;
  24.        proxy_set_header X-Real-IP $remote_addr;
  25.        proxy_set_header X-Forewarded-For  $proxy_add_x_forwarded_for;
  26.        proxy_set_header X-Forwarded-Proto $scheme;
  27.        proxy_set_header Authorization "";
  28.        proxy_pass       http://127.0.0.1:8080; #Jira port
  29.    }
  30.    #certbot ssl settings
  31.    #include /etc/nginx/global-ssl-settings.conf
  32.    #htaccess settings
  33. }
  34. server {
  35.    listen 443 ssl;
  36.    server_name subdomain1.domain.com;
  37.    root /var/www/subdomain1.domain.com
  38.    location / {
  39.        index index.html index.php
  40.    }
  41.    #certbot ssl settings
  42.    #htaccess settings
  43. }
  44. server {
  45.    listen 443 ssl;
  46.    server_name subdomain2.domain.com;
  47.    root /var/www/subdomain2.domain.com
  48.    location / {
  49.        index index.html index.php
  50.    }
  51.    #certbot ssl settings
  52.    #htaccess settings
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement