3 messages in ru.sysoev.nginxRe: static and dynamic content alias
FromSent OnAttachments
Alejandro VartabedianOct 23, 2007 11:14 am 
Igor SysoevOct 24, 2007 3:27 am 
Alejandro VartabedianOct 24, 2007 5:54 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: static and dynamic content aliasActions...
From:Alejandro Vartabedian (list@public.gmane.org)
Date:Oct 24, 2007 5:54:27 am
List:ru.sysoev.nginx

Igor Sysoev escribió:

On Tue, Oct 23, 2007 at 04:14:53PM -0200, Alejandro Vartabedian wrote:

i have those directives to mimic an apache Alias directive that works very well.

server { listen 80; server_name ws.lab; #somename alias another.alias;

location / { root /home/website/wsDev/http-dev/; index index.php index.html index.htm; } # Alias mimic begin location /phpmyadmin/ { alias /usr/share/phpmyadmin/; # alias static content index index.php index.html index.htm; }

nginx allows to set root at any level, so alias is required only if URI is not match FS layout. Here you can use

ok.

location /phpmyadmin/ { root /usr/share; index index.php index.html index.htm; }

location ~ /phpmyadmin/(.*).php$ {

- location ~ /phpmyadmin/(.*).php$ { + location ~ ^/phpmyadmin/.+\.php$ {

fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/$fastcgi_script_name; # alias dynamic content include /etc/nginx/fastcgi_params; } # Alias mimic end

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:8888 # location ~ .php$ {

- location ~ .php$ { + location ~ \.php$ {

fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/website/wsDev/http-dev$fastcgi_script_name; include /etc/nginx/fastcgi_params; } }

(mainly for the dynamic Alias mimic) is there place for a reduction of the settings? or other simpler way?

No.

ok, thanks.