Skip to content

Commit

Permalink
various tweaks to nginx vhost config file
Browse files Browse the repository at this point in the history
  • Loading branch information
inoryy committed Jun 6, 2013
1 parent c4d2471 commit cfc680b
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions etc/nginx/sites-available/example.com
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,46 @@ server {
rewrite ^/(.*)$ /app.php/$1;
}

# Uncomment only if you're *not* using LiipImagineBundle or similar image generation tool
# This context will mess with it and cache 404 for not yet generated images
# location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# expires 18h;
# add_header Cache-Control "public, must-revalidate, proxy-revalidate";
# }
location ~ ^/(app_dev|app)\.php(.*?)\.(?:ico|gif|jpe?g|png)$ {
expires 18h;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;

## uncomment redirect when using LiipImagineBundle!
## see this for reference http://stackoverflow.com/questions/16925886/nginx-accesslog-for-liipimaginebundle-images
# include fastcgi_params;
# fastcgi_pass 127.0.0.1:9000;
## fastcgi_pass unix:/tmp/php5-fpm.sock;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param HTTPS off;
}

location ~* \.(?:css|js)$ {
# You need to recompile nginx to use gzip_static
# See http://wiki.nginx.org/HttpGzipStaticModule
# gzip_static on;
# You need to recompile nginx to use gzip_static
# See http://wiki.nginx.org/HttpGzipStaticModule
# gzip_static on;

expires 18h;
add_header Cache-Control "publi, must-revalidate, proxy-revalidate";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

location ~ \.php {
limit_conn default 30;
# limit_conn default 30;

# Messes up with SEF URIs, not sure it's even needed
# try_files $uri =404;
# Messes up with SEF URIs, not sure it's even needed
# try_files $uri =404;

fastcgi_index app.php;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/tmp/php5-fpm.sock;

include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_PORT 80;
fastcgi_param SERVER_NAME example.com;
# fastcgi_param SERVER_PORT 80;
# fastcgi_param SERVER_NAME example.com;
}

location ~ /\.ht {
Expand Down

0 comments on commit cfc680b

Please sign in to comment.