Skip to content

Commit cfc680b

Browse files
committed
various tweaks to nginx vhost config file
1 parent c4d2471 commit cfc680b

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

etc/nginx/sites-available/example.com

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,46 @@ server {
2323
rewrite ^/(.*)$ /app.php/$1;
2424
}
2525

26-
# Uncomment only if you're *not* using LiipImagineBundle or similar image generation tool
27-
# This context will mess with it and cache 404 for not yet generated images
28-
# location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
29-
# expires 18h;
30-
# add_header Cache-Control "public, must-revalidate, proxy-revalidate";
31-
# }
26+
location ~ ^/(app_dev|app)\.php(.*?)\.(?:ico|gif|jpe?g|png)$ {
27+
expires 18h;
28+
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
29+
access_log off;
30+
31+
## uncomment redirect when using LiipImagineBundle!
32+
## see this for reference http://stackoverflow.com/questions/16925886/nginx-accesslog-for-liipimaginebundle-images
33+
# include fastcgi_params;
34+
# fastcgi_pass 127.0.0.1:9000;
35+
## fastcgi_pass unix:/tmp/php5-fpm.sock;
36+
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
37+
# fastcgi_param HTTPS off;
38+
}
3239

3340
location ~* \.(?:css|js)$ {
34-
# You need to recompile nginx to use gzip_static
35-
# See http://wiki.nginx.org/HttpGzipStaticModule
36-
# gzip_static on;
41+
# You need to recompile nginx to use gzip_static
42+
# See http://wiki.nginx.org/HttpGzipStaticModule
43+
# gzip_static on;
3744

3845
expires 18h;
39-
add_header Cache-Control "publi, must-revalidate, proxy-revalidate";
46+
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
4047
}
4148

4249
location ~ \.php {
43-
limit_conn default 30;
50+
# limit_conn default 30;
4451

45-
# Messes up with SEF URIs, not sure it's even needed
46-
# try_files $uri =404;
52+
# Messes up with SEF URIs, not sure it's even needed
53+
# try_files $uri =404;
4754

4855
fastcgi_index app.php;
4956
fastcgi_pass 127.0.0.1:9000;
57+
# fastcgi_pass unix:/tmp/php5-fpm.sock;
5058

5159
include fastcgi_params;
5260
fastcgi_split_path_info ^(.+\.php)(/.+)$;
5361
fastcgi_param PATH_INFO $fastcgi_path_info;
5462
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
5563
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
56-
fastcgi_param SERVER_PORT 80;
57-
fastcgi_param SERVER_NAME example.com;
64+
# fastcgi_param SERVER_PORT 80;
65+
# fastcgi_param SERVER_NAME example.com;
5866
}
5967

6068
location ~ /\.ht {

0 commit comments

Comments
 (0)