Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx redirecting to port 8080, when we have no trailing slash #10

Open
pedrosimao opened this issue Dec 6, 2023 · 0 comments
Open

Comments

@pedrosimao
Copy link

I am facing a strange issue with Nginx config.
When I try to put url directly on the browser without a trailing slash, my url gets redirected to 8080 port, and does not take into account the relative paths.
Here is my Nginx config:

server {
    listen       8080;
    server_name  localhost;
    root   /app;
    include /app/next-routes.conf;

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /app;
    }
}

And here is an example of my next-routes.conf:


location ~ ^/dashboards/controlcenter(?:/)?$ {
    try_files /index.html /index.html;
}

location ~ ^/dashboards/controlcenter/404(?:/)?$ {
    try_files /404.html /index.html;
}

location ~ ^/dashboards/controlcenter/audience_builder/audiences(?:/)?$ {
    try_files /audience_builder/audiences.html /index.html;
}

location ~ ^/dashboards/controlcenter/audience_builder/manage_categories(?:/)?$ {
    try_files /audience_builder/manage_categories.html /index.html;
}

location ~ ^/dashboards/controlcenter/audience_builder/query_templates(?:/)?$ {
    try_files /audience_builder/query_templates.html /index.html;
}

location ~ ^/dashboards/controlcenter/audience_builder/title_lists(?:/)?$ {
    try_files /audience_builder/title_lists.html /index.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant