Skip to content

Commit c4d2471

Browse files
committed
added various tweaks and fixes to symfony2 vhost
1 parent bf7b388 commit c4d2471

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

etc/nginx/sites-available/example.com

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

26-
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
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+
# }
32+
33+
location ~* \.(?:css|js)$ {
34+
# You need to recompile nginx to use gzip_static
35+
# See http://wiki.nginx.org/HttpGzipStaticModule
36+
# gzip_static on;
37+
2738
expires 18h;
28-
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
39+
add_header Cache-Control "publi, must-revalidate, proxy-revalidate";
2940
}
3041

3142
location ~ \.php {
32-
limit_conn default 50;
43+
limit_conn default 30;
3344

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

3648
fastcgi_index app.php;
3749
fastcgi_pass 127.0.0.1:9000;

0 commit comments

Comments
 (0)