The configuration guide for nginx recommends using a conditional statement to check if a file exists, which is listed on the nginx wiki as a common pitfall. It is not necessary to use a conditional and probably should not be recommended to do so.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- Restricted Diffusion Commit
rP3219039575fe: Update nginx configuration documentation.
We use this nginx configuration in our installation.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I think we should actually remove the "serve from disk" parts entirely (except for favicon.ico, although ideally this should be routed as well). At best, you get files which aren't transformed properly (for example, the ".css" files on disk aren't valid CSS, since they have color variables in them, and serving them directly is strictly wrong and will never work) and don't have the right caching headers. This has also caused some developer confusion in the past, e.g. when we added webfonts things that were wrong appeared to work correctly in a couple of edge cases.
(Far in the past I think we used a mixture of Celerity and non-celerity stuff to serve content, but all files we serve except favicon.ico should now be handled by Celerity.)
Let's remove everything except the favicon.ico rule, and then we can get rid of that eventually too?
Closed by commit rP3219039575fe (authored by @joshuaspence, committed by @epriestley).
src/docs/user/configuration/configuration_guide.diviner | ||
---|---|---|
95–96 | Oh, is this = extraneous? |
src/docs/user/configuration/configuration_guide.diviner | ||
---|---|---|
95–96 | No. It basically acts like a priority that tells nginx to stop trying to match locations. From the documentation:
|