Created
September 8, 2012 02:09
-
-
Save bobiko/3671344 to your computer and use it in GitHub Desktop.
nginx sites-available default
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; | |
server_name localhost; | |
access_log /var/log/nginx/www.access.log; | |
## Lokacja strony: | |
location / { | |
root /home/bobiko/www; | |
index index.php index.html index.htm; | |
} | |
## „Inne” traktowanie obrazkow i plikow statycznych | |
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { | |
access_log off; | |
expires 30d; | |
root /home/bobiko/www; | |
} | |
## Parsowanie wszystkich plikow .php w katalogu strony: /home/bobiko/www | |
location ~ .php$ { | |
root /home/bobiko/www; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass backend; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME /home/bobiko/www$fastcgi_script_name; | |
include fastcgi_params; | |
fastcgi_intercept_errors on; | |
fastcgi_ignore_client_abort off; | |
fastcgi_connect_timeout 60; | |
fastcgi_send_timeout 180; | |
fastcgi_read_timeout 180; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; | |
fastcgi_temp_file_write_size 256k; | |
} | |
## Blokowanie widzenia plikow .htaccess & .htpassword | |
location ~ /\.ht { | |
deny all; | |
} | |
## regulka dla wp | |
##location /wordpress { | |
## root /home/bobiko/www/wordpress; | |
## index index.php; | |
## if (!-e $request_filename) { | |
## rewrite ^/(.*)$ /wordpress/index.php last; | |
## break; | |
## } | |
##} | |
} | |
## Ustawienie portu na którym bedzie sie odbywac komunikacja z PHP | |
upstream backend { | |
server unix:/tmp/php-cgi.socket; | |
server 127.0.0.1:9000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment