User Tools

Site Tools


server_installation:nginx_proxy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
server_installation:nginx_proxy [2009/10/07 16:23] – server_name just complicates things; let nginx listen to all IP addresses / hostname dbsserver_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... 
- 
-<html><p>Steps to get this working on Ubuntu Karmic, assuming that nginx and Apache are running on the same server:</p> 
-<ol> 
-<li>Install nginx: <tt>sudo aptitude install nginx</tt></li> 
-<li>Copy the configuration file (below), changing "192.168.69.107" to match your server's IP address or host name, into a file called <tt>/etc/nginx/sites-available/evergreen</tt> and create a symbolic link to the file at <tt>/etc/nginx/sites-enabled/evergreen</tt></li> 
-<li>Modify <tt>/etc/apache2/ports.conf</tt> to change port 80 to 9080 and port 443 to 9443.</li> 
-<li>Modify <tt>/etc/apache2/eg_vhost.conf</tt> to change the "Listen 443" directive to "Listen 9443"</li> 
-<li>Restart nginx and Apache to put the new configuration in place</li> 
-<li>Enjoy!</li> 
-</ol></html> 
-<code> 
-# Change "192.168.69.107" throughout to match your server's host name or IP address 
- 
-server { 
-        listen 80; 
- 
-        root /openils/var/web; 
- 
-        access_log /var/log/nginx/evergreen.access.log; 
-        error_log /var/log/nginx/evergreen.error.log; 
- 
-        location /js/ {} 
- 
-        location ~* \.(css|gif|jpg|jpeg|js|png)$ { 
-                rewrite "^(/opac/)([a-z]{2}-[A-Z]{2}/)(.*\.)(css|gif|jpg|jpeg|js|png)$" $1$3$4 break; 
-        } 
- 
-        location / { 
-                rewrite ^(/?)$ /opac/en-US/skin/default/xml/index.xml redirect; 
-                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://localhost:9080; 
-                proxy_redirect off; 
-        } 
- 
-} 
- 
-server { 
-        listen 443; 
- 
-        root /openils/var/web; 
- 
-        ssl on; 
-        ssl_certificate /etc/apache2/ssl/server.crt; 
-        ssl_certificate_key /etc/apache2/ssl/server.key; 
- 
-        access_log /var/log/nginx/evergreen_ssl.access.log; 
-        error_log /var/log/nginx/evergreen_ssl.error.log; 
- 
-        location /js/ {} 
- 
-        location ~* \.(css|gif|jpg|jpeg|js|png)$ { 
-                rewrite "^(/opac/)([a-z]{2}-[A-Z]{2}/)(.*\.)(css|gif|jpg|jpeg|js|png)$" $1$3$4 break; 
-        } 
- 
-        location / { 
-                rewrite ^(/?)$ /opac/en-US/skin/default/xml/index.xml redirect; 
-                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://localhost:9443; 
-                proxy_redirect off; 
-        } 
-} 
-</code> 
  
server_installation/nginx_proxy.1254946981.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.