server { listen 0.0.0.0:80; server_name <%= ([site.name] + site.aliases).compact.map(&:punycode).join ' ' %>; set $sx_container "<%= container.name %>"; access_log /web/<%= container.name %>/logs/<%= site.name %>_access_nginx.log main; error_log /web/<%= container.name %>/logs/<%= site.name %>_error_nginx.log error; <% if site.use_apache? %> location ~* ^\/.+\.(jpg|jpeg|gif|png|svg|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm|ttf|eot|woff)$ { root <%= site.web.path.join(site.document_root) %>/; try_files $uri @backend; } location / { proxy_pass http://127.0.0.1:8080; } location @backend { proxy_pass http://127.0.0.1:8080; } <% else %> root <%= site.web.path.join(site.document_root) %>/; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:<%= site.web.path %>.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } <% end %> include /etc/nginx/server.conf.d/*.conf; }