Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # nginx.conf starts
- user www-data;
- worker_processes 1;
- error_log /var/log/nginx/error.log warn;
- pid /var/run/nginx.pid;
- events {
- worker_connections 256;
- }
- http {
- #
- tcp_nopush on;
- #
- tcp_nodelay on;
- #
- types_hash_max_size 2048;
- #
- server_tokens off;
- #
- client_max_body_size 8m;
- #
- reset_timedout_connection on;
- #
- # server_names_hash_bucket_size 64;
- #
- # server_name_in_redirect off;
- index index.php index.html index.htm;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/access.log combined;
- error_log /var/log/nginx/error.log;
- sendfile on;
- #tcp_nopush on;
- keepalive_timeout 65;
- gzip on;
- gzip_disable "msie6";
- gzip_vary on;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- upstream php7-fpm {
- keepalive 8;
- server unix:/var/run/php/php7.0-fpm.sock;
- }
- # include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
- # nginx.conf ends
- # generic server starts
- server {
- listen 80;
- server_name awebpage.com;
- root /absolute/path/to/the/files/;
- index index.php index.html index.htm;
- access_log /absolute/path/to/the/files/awebpage-access.log combined;
- error_log /absolute/path/to/the/files/awebpage-error.log;
- location /. { ## Disable access to .htaccess and other hidden files
- return 404;
- }
- # location / { ## Demands a user and password before enable access to the page
- # try_files $uri $uri/ /rampage.php?$args;
- # auth_basic "Restricted";
- # auth_basic_user_file /home/stoporose/meussites/victoralm.com/webalizer/.htpasswd;
- # autoindex on;
- # }
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
- fastcgi_param PHP_VALUE "cgi.fix_pathinfo=1";
- fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
- # generic server ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement