Created
July 15, 2015 22:15
-
-
Save pokap/be9f6915538f5e6108a7 to your computer and use it in GitHub Desktop.
Symfony2 nginx+hhvm config
This file contains hidden or 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
server { | |
server_name localhost; | |
listen 8080; | |
root /my/relative/project/web; | |
access_log /var/log/nginx/my_project.access.log; | |
error_log /var/log/nginx/my_project.error.log; | |
include /etc/nginx/symfony_default.conf; | |
} |
This file contains hidden or 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
listen 80; | |
server_tokens off; | |
location ~ \.php$ { | |
if ($uri ~ "^(.+\.php)($|/$)") { | |
set $script $1; | |
} | |
if ($uri ~ "^(.+\.php)(/.+)") { | |
set $script $1; | |
} | |
include fastcgi_params; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$script; | |
fastcgi_param SCRIPT_NAME $script; | |
fastcgi_param SERVER_PORT 80; | |
fastcgi_next_upstream off; | |
} | |
location / { | |
try_files $uri @php; | |
port_in_redirect off; | |
} | |
location @php { | |
set $script "/app.php"; | |
if ($uri ~ "^(.+\.php)($|/$)") { | |
set $script $1; | |
} | |
if ($uri ~ "^(.+\.php)(/.+)") { | |
set $script $1; | |
} | |
include fastcgi_params; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$script; | |
fastcgi_param SCRIPT_NAME $script; | |
fastcgi_param SERVER_PORT 80; | |
fastcgi_next_upstream off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment