Created
April 23, 2012 17:08
-
-
Save mindo/2472334 to your computer and use it in GitHub Desktop.
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
#user nobody; | |
worker_processes 1; | |
daemon off; | |
error_log /servers/logs/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; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for" $request_time'; | |
access_log /servers/logs/nginx/access.log main; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
#gzip on; | |
gzip on; | |
gzip_disable "MSIE [1-6]\."; | |
gzip_static on; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 4; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
server { | |
listen 80; | |
listen 443 ssl; | |
server_name vamosla.tmn.pt vamosla.pt; | |
ssl_certificate /servers/etc/nginx/ssl/vamosla.pt.crt; | |
ssl_certificate_key /servers/etc/nginx/ssl/vamosla.pt.key; | |
if ($server_port = 443) { set $https on; } | |
if ($server_port = 80) { set $https off; } | |
root /servers/vamosla/web; | |
access_log /servers/logs/nginx/vamosla.tmn.pt_access.log main; | |
if ($http_host != "vamosla.pt") { | |
rewrite ^ $scheme://vamosla.pt$request_uri? permanent; | |
} | |
#location ~ .*\.jpg$ { | |
# try_files $uri =404; | |
#} | |
# strip app.php/ prefix if it is present | |
rewrite ^/app\.php/?(.*)$ /$1 permanent; | |
location / { | |
index app.php; | |
try_files $uri @rewriteapp; | |
} | |
location @rewriteapp { | |
rewrite ^(.*)$ /app.php/$1 last; | |
} | |
location ~ ^/(app|app_dev)\.php(/|$) { | |
fastcgi_pass unix:/tmp/php-fpm.sock; | |
#fastcgi_pass 127.0.0.1:9000; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS $https; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment