Applications Servers or web servers such as Tomcat, JBoss or IIS are normally configured to handle all the requests by passing them to the web applications. The application then processes the request based on the type (GET,POST,...) and also the extension (.html, .do, .jspx, .aspx, ...).

Basically, when browser requests for a static file (JS, CSS or an image), it is processed by the application server and it delays serving the file by a fraction of time.When you have a reverse proxy server like Nginx or Apache on top of your application (web) server, you can easily reduce this time by going around the application server.

In Nginx this is easily done using setting alias. As you can see from the configuration below, you can set up an alias from your styles folder to a specific file system location and the rest is done by Nginx.

server

{

...

location /styles/ {

autoindex on;
alias /path/to/your/styles/folder/in/filesystem;
}
location /scripts/ {
autoindex on;
alias /path/to/your/scripts/folder/in/filesystem;
}

...

}

The above approach can save you processing resource and improve the performance of the website.