Advertisement
Guest User

NginxDjango

a guest
Nov 8th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. server {
  3.     listen                                      443;
  4.     ssl                                         on;
  5.     ssl_protocols                               TLSv1 TLSv1.1 TLSv1.2;
  6.     #ssl_ciphers                                 'AES256+EECDH:AES256+EDH';
  7.     ssl_prefer_server_ciphers                   on;
  8.     ssl_session_cache                           shared:SSL:10m;
  9.     ssl_certificate                             *yourcrtfile*
  10.     ssl_certificate_key                         *yourkeyfile*;
  11.  
  12.     server_name                                 *yourservername*;
  13.  
  14.     access_log                                  /var/log/nginx/*yourappname*.access.log;
  15.     error_log                                   /var/log/nginx/*yourappname*.error.log;
  16.  
  17.     keepalive_timeout                           0;
  18.    
  19.  
  20.     location = /blank.gif {                     empty_gif;}
  21.     location = /favicon.ico {                   empty_gif;}
  22.     location ~ /\.html {                        allow   all;}
  23.     location ~ /\.py {                          deny    all;}
  24.  
  25.     location / {
  26.         root                                        *yourstaticdirectory*;
  27.         client_max_body_size                    2048m;
  28.         client_body_buffer_size                 128k;
  29.         try_files                               $uri @uwsgi;
  30.     }
  31.  
  32.     location /static {
  33.         alias                                   *alias to static*;
  34.     }
  35.  
  36.     location /media {
  37.         alias                                   *alias to media*;
  38.     }
  39.  
  40.     location @uwsgi{
  41.         client_max_body_size                    2048m;
  42.         client_body_buffer_size                 128k;
  43.         include                                 uwsgi_params;
  44.         uwsgi_param HTTPS                       on;
  45.         uwsgi_pass                              127.0.0.1:*uwsgitcpport*;
  46.         uwsgi_read_timeout                      300;
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement