Advertisement
Guest User

nginx.config

a guest
Jul 5th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.98 KB | None | 0 0
  1. server {
  2.         listen 443 ssl;
  3.         server_name monitorsky.com;
  4.  
  5.         client_max_body_size 20m;
  6.  
  7.         ## Deny illegal Host headers
  8.         if ($host !~* ^monitorsky\.com$ ) {
  9.                 return 444;
  10.         }
  11.    
  12.     location /robots.txt {
  13.         add_header Content-Type text/plain;
  14.                 alias /home/monitorsky/static_root/txt/robots.txt;
  15.         }
  16.     location /static/video/ {
  17.                 mp4;
  18.                 mp4_buffer_size     1m;
  19.                 mp4_max_buffer_size 20m;
  20.                 alias /home/monitorsky/static_root/video/;
  21.         }
  22.        
  23.         location /static/{
  24.                 alias /home/monitorsky/static_root/;
  25.         }
  26.     location /media/ {
  27.                 alias /home/monitorsky/media/;
  28.         }
  29.         location /{
  30.                 if (!-f /var/run/uwsgi/app/monitorsky/pid) {
  31.                         return 503;
  32.                 }
  33.         if ($http_user_agent ~* (SkypeUriPreview) ) {
  34.                    return 444;
  35.                 }
  36.  
  37.                 include uwsgi_params;
  38.                 uwsgi_pass unix:///var/run/uwsgi/app/monitorsky/socket;
  39.                 uwsgi_param     HTTP_X_FORWARDED_PROTOCOL       $scheme;
  40.         }
  41.  
  42.  
  43.         include ssl_params;
  44.         error_page 500 501 502 503 504 /500/;
  45.         #error_page 503 @maintenance;
  46.  
  47.         #location @maintenance {
  48.         #        root /home/;
  49.         #        rewrite ^(.*)$ /maintenance.html break;
  50.         #}
  51. }
  52.  
  53. server {
  54.     listen 80;
  55.     server_name www.monitorsky.com;
  56.    
  57.     location ~ /.well-known {
  58.         allow all;
  59.     }
  60.  
  61.     location / {
  62.         return 301 https://monitorsky.com$request_uri;
  63.     }
  64. }
  65.  
  66. server {
  67.     listen 443 ssl;
  68.     server_name www.monitorsky.com;
  69.     include ssl_params;
  70.     return 301 https://monitorsky.com$request_uri;
  71. }
  72.  
  73. server {
  74.     listen 80;
  75.     server_name monitorsky.com;
  76.    
  77.     location ~ /.well-known {
  78.         allow all;
  79.     }
  80.  
  81.     location / {
  82.     return 301 https://monitorsky.com$request_uri;
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement