Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user http;
- worker_processes auto;
- error_log /var/log/nginx/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- access_log /var/log/nginx/access.log;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- #gzip on;
- # Add headers to serve security related headers
- add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
- add_header X-Content-Type-Options nosniff;
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Robots-Tag none;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- server {
- listen 80;
- server_name b...;
- # enforce https
- return 301 https://$server_name$request_uri;
- }
- server {
- listen 443;
- server_name b....;
- ssl_certificate /etc/nginx/ssl/key.crt;
- ssl_certificate_key /etc/nginx/ssl/key.key;
- #charset koi8-r;
- location / {
- root /srv/http/;
- index index.php index.html index.htm;
- }
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- root /srv/http;
- fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- include fastcgi.conf;
- }
- }
- include servers-enabled/*;
- }
Advertisement
Add Comment
Please, Sign In to add comment