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

398 resolve nginx 404 #292

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Conversation

springstim
Copy link
Contributor

Note: Due to the way the envsubst in this container's startup process rewrites the nginx template file, we couldn't pass any '$' characters to be preserved in the rendered nginx/conf.d/default.conf file (such as $scheme). So we created an envar with the NGINX rewrite target for 404 as a quoted string rather than a literal within the nginx-template.conf file. This container envar is rendered by envsubst to become a string in the NGINX configuration containing NGINX variables such as '$scheme' and '$host' to specify the redirection target. The actual /usr/share/nginx/html/404.html is no longer used although it hasn't been removed from the base layer.

Previous logic rendered the 404.html static page in-place that created subsequent 404 redirects for assets expected to be along the original URL path, causing requests such as /x/y/z.html to result in /x/y/404.html which didn't have the context for the assets.

Copy link
Contributor

@jaredgalanis jaredgalanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants