## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; client_max_body_size 400M; # SSL configuration # #listen 443 ssl default_server; #listen [::]:443 ssl default_server; #add_header Strict-Transport-Security "max-age=0;"; #add_header X-XSS-Protection "0"; #add_header X-XSS-Protection "1; mode=block"; #add_header X-Frame-Options "SAMEORIGIN"; #add_header X-Content-Type-Options nosniff; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # #include /srv/etc/nginx/self-signed.conf; #include /srv/etc/nginx/ssl-params.conf; root /srv/www/web; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; index index.html index.php; } # pass PHP scripts to FastCGI server # location ~ \.php$ { #keepalive_timeout 0; include snippets/fastcgi-php.conf; #fastcgi_hide_header X-Frame-Options; fastcgi_pass unix:/run/php/php-fpm.sock; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~* /jsapi_dynamic/.+\.js$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php-fpm.sock; } location /video_feed/ { proxy_pass http://127.0.0.1:8972; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) reset_timedout_connection on; } location /video_view/ { proxy_pass http://127.0.0.1:8974; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) reset_timedout_connection on; } location ~ /\.ht { deny all; } }