Created
June 15, 2015 19:05
-
-
Save ceosisdeve/95ef83e544100f51467f to your computer and use it in GitHub Desktop.
Vhosts Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen *:80; ## porta | |
server_name Dominio *.Dominio; | |
root /var/www/Dominio/web/public; | |
index index.html index.htm index.php index.cgi index.pl index.xhtml; | |
error_log /var/log/ispconfig/httpd/Dominio/error.log; | |
access_log /var/log/ispconfig/httpd/Dominio/access.log combined; | |
location ~ /\. { | |
deny all; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
location /stats/ { | |
index index.html index.php; | |
auth_basic "Members Only"; | |
auth_basic_user_file /var/www/clients/client0/web1/web/stats/.htpasswd_stats; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?$uri&$args; | |
} | |
location ~ \.(php|phtml)?$ { | |
include /etc/nginx/fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
fastcgi_param APPLICATION_ENV development; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
} | |
location ~ .*\.(?:ico|git|jpg?g|png|bmp|swf|css|js|gif)?$ { | |
expires max; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment