安装nginx

/opt/bin/opkg install nginx

修改配置文件

vi /opt/etc/nginx/nginx.conf

nginx.conf内容

user nobody; worker_processes 1; #error_log /opt/var/log/nginx/error.log; #error_log /opt/var/log/nginx/error.log notice; #error_log /opt/var/log/nginx/error.log info; #pid /opt/var/run/nginx.pid; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; autoindex on; autoindex_exact_size off; autoindex_localtime off; charset utf-8,gbk; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; limit_zone one $binary_remote_addr 32k; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /opt/var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 8088; server_name localhost; root /media/mmcblk0p5; index index.html index.htm; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~* ^.+\.php(\/.*)*$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } }

重启nginx

/opt/sbin/nginx -s reload
如果觉得我的文章对你有用,请随意赞赏