Welcome! Log In Create A New Profile

Advanced

Re: Nginx with php configuration how to block all requests/urls other than two?

January 30, 2015 02:51AM
Thanks for the help guys i have it working but i am not sure what config i should be using out of these two what one would be better.

itpp2012's config :

map $request $allowonly {
default 1;
~*addmedia\.upload([a-zA-Z0-9-_=&]) 0;
}
server {
listen 80;
listen [::]:80;
server_name sub1.domain.com;
index index.php index.html index.htm default.html default.htm;
location / {
return 404;
}
location /media/com_hwdmediashare/assets/swf/Swiff.Uploader.swf {
root z:/public_www;
expires max;
}
location ~ \.php$ {
if ($allowonly) {
return 403;
}
try_files $uri =404;
##fastcgi stuff here
}
}


And then the config Francis recommends :

server {
listen 80;
listen [::]:80;
server_name sub1.domain.com;
location / {
return 404;
}
location = /index.php {
if ( $args !~ 'option=com_hwdmediashare&task=addmedia.upload' ) {
return 404;
}
try_files $uri =404;
# do whatever (So fastcgi stuff here)
}
location = /media/com_hwdmediashare/assets/swf/Swiff.Uploader.swf {
root z:/public_www;
expires max;
}
}

itp2012's config is the one i am currently using and works well should i change anything or just stick with it :) ?
Subject Author Posted

Nginx with php configuration how to block all requests/urls other than two?

c0nw0nk January 29, 2015 09:20AM

Re: Nginx with php configuration how to block all requests/urls other than two?

itpp2012 January 29, 2015 10:09AM

Re: Nginx with php configuration how to block all requests/urls other than two?

c0nw0nk January 29, 2015 10:55AM

Re: Nginx with php configuration how to block all requests/urls other than two?

itpp2012 January 29, 2015 12:29PM

Re: Nginx with php configuration how to block all requests/urls other than two?

B.R. January 29, 2015 12:58PM

Re: Nginx with php configuration how to block all requests/urls other than two?

Francis Daly January 29, 2015 01:48PM

Re: Nginx with php configuration how to block all requests/urls other than two?

c0nw0nk January 30, 2015 02:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
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