Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a webapp built in angular.js and angular. Since angular takes care of most urls by itself, i want to serve the file indexAng.html (along with any arguments) in response to a request for /search/?arg1=x&arg2=y

I've tried to do this with location blocks like this:

location /search/ {
    alias /home/dotcloud/current/static/public/;
    index indexAng.html;

This seems to work, but i don't know how to serve the arguments with it. How do I serve arguments with indexAng.html, and is there a better or more appropriate way to go about this?

share|improve this question
What is it that you want to happen? The last time I checked, a static HTML page couldn't do a whole lot with arguments anyway... –  Michael Hampton Nov 1 '12 at 3:16
It's not a static file, it's an angular.js file. The file indexAng.html will take the arguments and deal with them appropriately. What I want to happen is the url to say www.example.com/search/?arg1=x&arg2=y and the file sent back by nginx to be indexAng.html. –  jmetz Nov 1 '12 at 3:18
my current setup seems to drop the arguments. –  jmetz Nov 1 '12 at 3:19
Of course, nginx thinks it's a static HTML page, for which arguments are utterly meaningless. As far as angular.js goes, I have no idea, and ironically their web site is utterly broken if you have JavaScript disabled (!)... –  Michael Hampton Nov 1 '12 at 3:23
Is there no way to take a request such as /search?arg1=x and return an html file with nginx. I am a complete nginx noob but I feel like this shouldn't be that difficult. –  jmetz Nov 1 '12 at 3:30

Your Answer


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

Browse other questions tagged or ask your own question.