server_installation:nginx_proxy
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
server_installation:nginx_proxy [2009/10/04 01:29] – created nginx documentation dbs | server_installation:nginx_proxy [2017/04/11 09:33] (current) – Delete old experimental content to avoid confusion now that nginx has some official docs dbs | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Using nginx to serve static content ====== | ||
- | A default Evergreen install uses Apache to serve up both static and dynamic content. This causes Apache to have to constantly respawn backend processes. Using a high-performance proxy server to serve up static content and pass on the dynamic requests to Apache can make you, your server, and your users happier. The following document is based on a full handful of late-night hours trying out nginx for the first time, so use at your own risk... | ||
- | |||
- | < | ||
- | <ol> | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | < | ||
- | # Change " | ||
- | |||
- | server { | ||
- | listen 192.168.69.107: | ||
- | |||
- | server_name 192.168.69.107; | ||
- | root / | ||
- | |||
- | access_log / | ||
- | error_log / | ||
- | |||
- | location /js/ {} | ||
- | |||
- | location ~* \.(css|gif|jpg|jpeg|js|png)$ { | ||
- | rewrite " | ||
- | } | ||
- | |||
- | location / { | ||
- | rewrite ^(/?)$ / | ||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | proxy_pass http:// | ||
- | proxy_redirect off; | ||
- | } | ||
- | |||
- | } | ||
- | |||
- | server { | ||
- | listen 192.168.69.107: | ||
- | server_name 192.168.69.107; | ||
- | root / | ||
- | |||
- | ssl on; | ||
- | ssl_certificate / | ||
- | ssl_certificate_key / | ||
- | |||
- | access_log / | ||
- | error_log / | ||
- | |||
- | location /js/ {} | ||
- | |||
- | location ~* \.(css|gif|jpg|jpeg|js|png)$ { | ||
- | rewrite " | ||
- | } | ||
- | |||
- | location / { | ||
- | rewrite ^(/?)$ / | ||
- | proxy_set_header X-Real-IP $remote_addr; | ||
- | proxy_set_header Host $host; | ||
- | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
- | proxy_pass https:// | ||
- | proxy_redirect off; | ||
- | } | ||
- | } | ||
- | </ | ||
server_installation/nginx_proxy.1254634175.txt.gz · Last modified: 2022/02/10 13:34 (external edit)