Nginx Rewrite route to index.php Except /phpmyadmin AND url shortening / handling / splitting
Hej har et spørgsmål på stackoverflow omkring min nginx conf og få phpmyadmin ind i min url rewriting
Nogen foreslag :)?
http://stackoverflow.com/questions/15563977/nginx-rewrite-route-to-inde…
############
Hi first question on stackoverflow :)
Im routing everything to index.php so i can handle url shortening and internal routing there
tryed nginx rewrite all to index.php except whitelist no succes
my url shortening is breaking phpmyadmin So i have to add some extra routing in nginx
That works but on my phpmyadmin rule i get a NGINX 404, everything else i get my own 404
Nogen foreslag :)?
http://stackoverflow.com/questions/15563977/nginx-rewrite-route-to-inde…
############
Hi first question on stackoverflow :)
Im routing everything to index.php so i can handle url shortening and internal routing there
tryed nginx rewrite all to index.php except whitelist no succes
my url shortening is breaking phpmyadmin So i have to add some extra routing in nginx
That works but on my phpmyadmin rule i get a NGINX 404, everything else i get my own 404
server {
listen 80;
server_name localhost;
root /home/arch/Web/www/cms;
location / {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ( $uri !~ ^/(index\.php|css|images|phpmyadmin|js|robots\.txt|favicon\.ico) ){
rewrite ^ /index.php last;
}
}
location /phpmyadmin/ {
root /home/arch/Web/www/cms/phpMyAdmin;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
#location /images/ {
#root /home/arch/Web/www/cms/shared/images;
#}
location ~ \.cgi$ {
fastcgi_pass unix:/run/fcgiwrap.sock;
include fastcgi.conf;
}
location ~ \.pl$ {
fastcgi_pass unix:/run/fcgiwrap.sock;
include fastcgi.conf;
}
}
Kommentarer