1

I'm trying to run an angularjs application along with an php application. I made 2 folders ( client & api ) and I uploaded all my angular app files in client and all my php rest api into "api" directory.

I added into nginx:

location / {
      try_files $uri /client/index.html;
}
location /api/ {
      try_files $uri $uri/ /api/index.php$args;
}
location /static {
      alias /var/www/www.sitename.com/htdocs/client/static/;
}

I'm wondering if is there a more elegant way to make this work, because right now if i want to add an exception to "location /" i need to go and modify nginx again.

Please advise.

2
  • Were you ever able to get this working? I have the same problem within my app as well. stackoverflow.com/questions/20579481/… Commented Dec 16, 2013 at 22:30
  • Is working like it is, but I haven't tried to make it better Commented Jan 31, 2014 at 7:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.