Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an application that is IP restricted via an .htaccess file. Another application is used to request access and updates the .htaccess with the users IP for a period of time.

The current server configuration uses just one box, so it is easy to update the htaccess. However we are looking at moving the application to a scale-able environment which means the htaccess will be on multiple servers rather than just one.

I was thinking an access file could be updated in the nginx load balancer (which will be the single point of entry before the servers). However after some research it looks like htaccess type files don't exist on nginx and the second problem is, other applications will exist on the server that are not IP restricted.

One potential workaround is to have the access tokens based on the application database, but I'd rather not make any application changes at the moment if possible.

Can anyone advise on other ways to allow users to request access to an application for a set period of time?

share|improve this question

How about configuring a reverse proxy on apache in front of your nginx with your htaccess? Sounds a bit overkill but it would work.

share|improve this answer

You could make the application write the htaccess on both servers? Maybe mount the second server via sshfs/nfs/... on the first and then have the application that updates the htaccess file write to both places (or rsync).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.