Welcome! Log In Create A New Profile

Advanced

Re: specific to index.php rest of them index.html

October 03, 2016 09:54AM
This is for symfony2 project.

location ~ /location1 {
fastcgi things;
}

location ~ /location2 {
fastcgi things;
}

location ~ /location3 {
fastcgi things;
}


location / {
index index.html;
}

Above examples how fit to symfony2 below. Mine is


# dev
location ~ ^(app_dev|config)\.php$ {
fastcgi things;
}

# prod
location ~ ^app.php {
fastcgi things;
}

location ~ \.php {
deny all;
}

location / {
try_files;
}

On Mon, Oct 3, 2016 at 8:40 PM, Richard Stanway <r1ch+nginx@teamliquid.net>
wrote:

> Why not use the location directive? This is what it is designed for.
>
> http://nginx.org/en/docs/http/ngx_http_core_module.html#location
>
>
> On Mon, Oct 3, 2016 at 12:28 PM, Tseveendorj Ochirlantuu <
> tseveendorj@gmail.com> wrote:
>
>> Hello,
>>
>> I need to configure some locations go to index.php rest go to index.html
>>
>>
>> if ($request_uri !~ ^/(location1|location2|location3)$ ) {
>> rewrite ^(.*) /index.html;
>> }
>>
>> but how to else ?
>>
>> if the request contains location1, location2, location3 goes to
>> fastcgi_pass 127.0.0.1:9000;
>> if not contain go to /index.html
>>
>> regards,
>> tseveen
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

specific to index.php rest of them index.html

Eberx October 03, 2016 06:30AM

Re: specific to index.php rest of them index.html

Richard Stanway October 03, 2016 08:42AM

Re: specific to index.php rest of them index.html

Eberx October 03, 2016 09:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready