Page MenuHomePhabricator

Update nginx configuration documentation.
ClosedPublic

Authored by joshuaspence on Jun 6 2014, 12:06 AM.
Tags
None
Referenced Files
F13230758: D9401.diff
Mon, May 20, 11:18 PM
F13218439: D9401.id.diff
Sat, May 18, 12:35 PM
F13216405: D9401.diff
Sat, May 18, 12:33 AM
F13186467: D9401.diff
Sat, May 11, 3:39 AM
Unknown Object (File)
Tue, May 7, 5:36 AM
Unknown Object (File)
Fri, May 3, 3:50 AM
Unknown Object (File)
Mon, Apr 29, 2:53 PM
Unknown Object (File)
Sat, Apr 27, 12:42 AM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP3219039575fe: Update nginx configuration documentation.
Summary

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.

Test Plan

We use this nginx configuration in our installation.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Update nginx configuration documentation..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

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?

This revision now requires changes to proceed.Jun 7 2014, 7:00 PM
joshuaspence edited edge metadata.
  • Don't server /rsrc/ directly from disk.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 7 2014, 7:08 PM
epriestley updated this revision to Diff 22488.

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:

Also, using the “=” modifier it is possible to define an exact match of URI and location. If an exact match is found, the search terminates.