Welcome! Log In Create A New Profile

Advanced

Re: location not working

Francis Daly
April 09, 2021 02:56AM
On Thu, Apr 08, 2021 at 04:36:47PM -0400, uragnorson wrote:

Hi there,

> location / {
> root /usr/share/nginx.html;
> }
>
> location /dist/ {
> alias /usr/share/nginx/html/dist/;
> }

Because, in this case, the "location" part matches the end of the "alias"
part, you could instead choose to use "root" here as well.

http://nginx.org/r/alias

> I am able to navigate to http://server/dist but in dist the index.html is
> looking for http://server/js but it should be http:/server/dist/js is there
> a way to add the extra "dist" ?

The easiest way would be to change the index.html.

If it refers to http://server/js or to /js, make it instead refer to js.

Failing that, you could try setting up extra location{}s or redirects
to handle this one exception; but I imagine that will turn in to "just
one more exception as well...", multiple times.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

location not working

uragnorson April 08, 2021 04:36PM

Re: location not working

Francis Daly April 09, 2021 02:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready