Skip to content

Instantly share code, notes, and snippets.

@wa1one
Created October 10, 2015 10:28
Show Gist options
  • Save wa1one/c77b432628f400978672 to your computer and use it in GitHub Desktop.
Save wa1one/c77b432628f400978672 to your computer and use it in GitHub Desktop.
Nginx config kohana + pgadmin in subfolder
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/html/oto.kz/;
index index.php;
# Make site accessible from http://localhost/
server_name oto.kz;
location / {
# don't check $uri/, send to php for nice error message
try_files $uri /index.php?$query_string;
}
location /application {
rewrite ^/(?:application|modules|system)\b.* /index.php$request_uri;
}
location /modules {
rewrite ^/(?:application|modules|system)\b.* /index.php$request_uri;
}
location /system {
rewrite ^/(?:application|modules|system)\b.* /index.php$request_uri;
}
location ~ ^/index.php {
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param KOHANA_ENV development;
fastcgi_cache off;
fastcgi_index index.php;
}
location /pgadmin {
alias /var/www/html/oto.kz/pgadmin/;
try_files $uri $uri/ /index.php;
}
location ~ ^/pgadmin(.+\.php)$ {
alias /var/www/html/oto.kz/pgadmin$1;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/oto.kz/pgadmin$1;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment