Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


Nginx Fullstack App Docker

02 Oct 2022 »

https://serverfault.com/questions/656380/nginx-proxy-pass-with-uri-modification

location  ~ ^/app/(.*)$ {
# proxy_pass   http://127.0.0.1/some_dir;       # error
proxy_pass   http://127.0.0.1/some_dir/$1;      # ok
}

isn’t passing parameters

location ^~ /jazz/ {
    rewrite ^/jazz/(.*)$ /$1? break;
    proxy_pass http://vito_api;
}

https://stackoverflow.com/questions/8130692/how-can-query-string-parameters-be-forwarded-through-a-proxy-pass-with-nginx

location ~* ^/service/(.*) {
  proxy_pass http://apache/$1$is_args$args;
}

https://stackoverflow.com/questions/39837080/how-to-use-try-files-with-2-or-more-roots

location /static {
    root /usr/local/www;
    try_files /style1$uri /style2$uri /style3$uri =404;
}