Welcome! Log In Create A New Profile

Advanced

Need help with alias/rewrite from apache

Posted by mailfigo 
Need help with alias/rewrite from apache
September 13, 2011 06:17AM
Hi i need help with AliasMatch rule for nginx,
I am migrating from Apache, i have setup everything, except some AliasMatch rules,
Is there any way we can convert these (below) rules in nginx;

AliasMatch ^/global-(.*) /home/demo/html/all-tenders.php
AliasMatch ^/(.*)-contracts(.*).php /home/demo/html/all-contracts.php
AliasMatch ^/(.*)-news(.*).php /home/demo/html/all-news.php
AliasMatch ^/details-(.*) /home/demo/html/show-summary.php
AliasMatch ^/daily-queries-(.*) /home/demo/html/daily-tenders.php
AliasMatch ^/upload-images(.*) /home/demo/html/up-images/show.php
AliasMatch ^/profile(.*) /home/demo/html/profile-display.php

Any help would be appreciated,
Thanks in Advance.
Re: Need help with alias/rewrite from apache
September 18, 2011 09:27AM
try:

location /global- {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/all-tenders.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}

location ~ ^/.*-contracts.*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/all-contracts.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}

location /details- {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/show-summary.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}

location /daily-queries- {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/daily-tenders.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}

location /upload-images {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/up-images/show.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}

location /profile {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/demo/html/profile-display.php;
fastcgi_pass phpfarm; # replace 'phpfarm' with your fastcgi host/socket
}


Andrejs
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready