Goto @loc; / return @loc;


Here is a simplified example of my nginx config

location /loc1 {
location ~ .(css|js)$ {
try_files $uri @loc1;
return 599;
error_page 599 = @loc1;
location @loc1 {
fastcgi_index index.aspx; # Page par defaut
fastcgi_pass unix:/tmp/loc1.sock;

The idea is that I have over 20 location for 20 fastcgi applications.
I want the .css & .js to be served by nginx if they exist else let the
fastcgi app handle the request.
The named location can be more complicated (i want to avoid copy/paste)

First is my config ok (it’s working but is it “best practice”)?

Second what do you think of a new “goto @loc1” or “return @loc1
The return / error_page combo is a bit of a hack.
I’m willing to write a patch if devs think it a good/valid use case.

Thanks in advance

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs