Differences

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

doc:howto:http.nginx [2013/01/19 09:44]
orca
doc:howto:http.nginx [2014/06/05 19:11] (current)
tmomas Formatting corrected + outdated info removed (nginx is well available in BB)
Line 1: Line 1:
-====== nginx ======+====== Nginx ======
-WIP, by trial and error. This is what I did to make PHP5 to work.+[[http://wiki.nginx.org/|Nginx]] is a high-performance http-server with other functions as well. 
 +It is a perfect candidate to run on OpenWRT due to the performance and memory handling.
===== Installation ===== ===== Installation =====
Line 9: Line 10:
</code> </code>
-Note: nginx are not precompiled in barrier breaker release. Read notes+Of course there will be port issues if you installed LuCI before or after nginx, since LuCI package installs uhttpd, which also wants to claim port 80
- +So configuring and/or portforwarding may be neccessary. There are ways to run LuCI with another http daemon but that is not coverd here
-Solution: Either try [[doc/techref/opkg|force-depends]] on downloaded package from AA or [[doc/howtobuild/single.package|recompile]] for your specific device+For a quick fix, just change the uhttpd port to something else in ''/etc/config/uhttpd''.
- +
-[[http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/|http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/]] ARCH /generic/packages/nginx_1.2.2-1_ARCH.ipk+
==== Configuration Files ==== ==== Configuration Files ====
-The configuration files resides in /etc/ folder, nginx own files are in their own folder /etc/nginx/+
=== nginx.conf === === nginx.conf ===
-/etc/nginx/nginx.conf+ 
 +''/etc/nginx/nginx.conf'' 
<code> <code>
user nobody nogroup; user nobody nogroup;
Line 48: Line 49:
gzip_vary on; gzip_vary on;
server { server {
-         listen      80; +         listen      80; # Port, make sure it is not in conflict with another http daemon. 
-         server_name  YOUR_SERVER;+         server_name  YOUR_SERVER; # Change this, reference -> http://nginx.org/en/docs/http/server_names.html
fastcgi_connect_timeout 300; fastcgi_connect_timeout 300;
fastcgi_send_timeout 300; fastcgi_send_timeout 300;
Line 59: Line 60:
client_body_timeout 10; client_body_timeout 10;
client_header_timeout 10; client_header_timeout 10;
- send_timeout 60;+ send_timeout 60; # 60 sec should be enough, if experiencing a lot of timeouts, increase this.
output_buffers 1 32k; output_buffers 1 32k;
postpone_output 1460; postpone_output 1460;
- root  /mnt/data/www;+ root  /mnt/data/www; # Your document root, where all public material is.
location ~ \.php$ { location ~ \.php$ {
fastcgi_index  index.php; fastcgi_index  index.php;
- fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 
include        fastcgi_params; include        fastcgi_params;
 + fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
if (-f $request_filename) { if (-f $request_filename) {
Line 80: Line 81:
=== php.ini === === php.ini ===
-/etc/php.ini+''/etc/php.ini''
<code> <code>
doc_root = "YOUR/DOCUMENT/ROOT" doc_root = "YOUR/DOCUMENT/ROOT"
Line 88: Line 89:
=== fastcgi_params === === fastcgi_params ===
-Resides in /etc/nginx/.+''/etc/nginx/fastcgi_params'' 
If for what ever reason it was modified or wasn't, this one will work. If for what ever reason it was modified or wasn't, this one will work.
 +
<code> <code>
fastcgi_param  QUERY_STRING      $query_string; fastcgi_param  QUERY_STRING      $query_string;
Line 115: Line 118:
fastcgi_param  REDIRECT_STATUS    200; fastcgi_param  REDIRECT_STATUS    200;
</code> </code>
 +
===== Error Log ===== ===== Error Log =====
Error log is your friend. Error log is your friend.

Back to top

doc/howto/http.nginx.1358585050.txt.bz2 · Last modified: 2013/01/19 09:44 by orca