Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I would like to configure my system so nginx is serving all of the the static files, while Tomcat is handling the dynamic .jsp pages.

Is there a best practice for this?

share|improve this question

closed as off-topic by Ward, masegaloeh, Jenny D, kasperd, Katherine Villyard May 24 '15 at 23:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Please consider accepting some of your previous answers. Why should I go to the trouble of helping you, when you don't give anything back? If you don't know what I mean, I suggest you read the FAQ. – Bryan Apr 2 '10 at 12:41

Does tomcat accessible via HTTP? If yes, then Imagine we have some tomcat which serves on the same machine on port 88 queries which ends up with .jsp

The config file will be like:

location / {
  root /path/to/static/files;

location ~* \.jsp {

The main idea is that nginx proxies requests that it couldn't handle to specific backend (backend will see request from

share|improve this answer

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