Welcome! Log In Create A New Profile

Advanced

restrict sub-directory access divert if not authenticated

March 16, 2015 01:11AM
I am moving from a development server to a live server and would like to still test before REALLY going live.

I need to redirect access to a sub-folder until I am satisfied with the stability

this is what i have:
-------------------------------------------------------------
server {
listen 80;
server_name hostname.com

#other configurations

location ~ \.php$ {
#fastcgi configurations
}

# now for the new sub-site


location /shop/ {
# I would like to redirect to ShopSoonToOpenAdvertisement.html if deny
satisfy any;
allow 203.0.0.133; # my testing server and some client's ip's for testing
deny all;
auth_basic "sorry but this page is off limits - please go back to <a href='hostname.com'>hostname.com</a>";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}

--------------------------------------------------------------

for this config the server does not allow access to hostname.com/shop/

but

hostname.com/shop/index.php

will render the page sans the .js, css, etc...

I would like to show the shop if passw or allow is satisfied else redirect to a static html file


Any suggestions??
Subject Author Posted

restrict sub-directory access divert if not authenticated

jacograaff March 16, 2015 01:11AM

Re: restrict sub-directory access divert if not authenticated

Dmitry Pryadko March 16, 2015 06:38AM

Re: restrict sub-directory access divert if not authenticated

jacograaff March 16, 2015 07:59PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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