我有一个openWRT正在运行,我已经安装了nginx。 Nginx在端口80上运行得非常好。为了避免/ etc / config / uhttpd中的冲突,我将端口从80更改为89,但是当我在Web浏览器中打开它时,我得到"索引为/ "而不是Luci的Web界面。这可能是什么错误?
提前谢谢。
Nginx.conf
user nobody nogroup;
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
index index.php index.html index.htm;
default_type text/html;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_min_length 1k;
server {
listen 80; # слушающий порт
server_name 192.168.1.1; # имя или ip-адрес сервера
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 32k;
fastcgi_buffers 4 32k;
fastcgi_busy_buffers_size 32k;
fastcgi_temp_file_write_size 32k;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 60;
output_buffers 1 32k;
postpone_output 1460;
root /www/wifi; # Папка с файлами сайта
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
if (-f $request_filename) {
fastcgi_pass 127.0.0.1:1026;
}
}
}
}
uhttpd config
# Server configuration
config uhttpd main
# HTTP listen addresses, multiple allowed
list listen_http 0.0.0.0:89
# list listen_http [::]:80
# HTTPS listen addresses, multiple allowed
list listen_https 0.0.0.0:443
# list listen_https [::]:443
# Server document root
option home /www
# Reject requests from RFC1918 IP addresses
# directed to the servers public IP(s).
# This is a DNS rebinding countermeasure.
option rfc1918_filter 1
# Maximum number of concurrent requests.
# If this number is exceeded, further requests are
# queued until the number of running requests drops
# below the limit again.
option max_requests 3
# Certificate and private key for HTTPS.
# If no listen_https addresses are given,
# the key options are ignored.
option cert /etc/uhttpd.crt
option key /etc/uhttpd.key
# CGI url prefix, will be searched in docroot.
# Default is /cgi-bin
option cgi_prefix /cgi-bin
# List of extension->interpreter mappings.
# Files with an associated interpreter can
# be called outside of the CGI prefix and do
# not need to be executable.
# list interpreter ".php=/usr/bin/php-cgi"
# list interpreter ".cgi=/usr/bin/perl"
# Lua url prefix and handler script.
# Lua support is disabled if no prefix given.
# option lua_prefix /luci
# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua
# CGI/Lua timeout, if the called script does not
# write data within the given amount of seconds,
# the server will terminate the request with
# 504 Gateway Timeout response.
option script_timeout 60
# Network timeout, if the current connection is
# blocked for the specified amount of seconds,
# the server will terminate the associated
# request process.
option network_timeout 30
# TCP Keep-Alive, send periodic keep-alive probes
# over established connections to detect dead peers.
# The value is given in seconds to specify the
# interval between subsequent probes.
# Setting this to 0 will disable TCP keep-alive.
option tcp_keepalive 1
# Basic auth realm, defaults to local hostname
# option realm OpenWrt
# Configuration file in busybox httpd format
# option config /etc/httpd.conf
# Certificate defaults for px5g key generator
config cert px5g
# Validity time
option days 730
# RSA key size
option bits 1024
# Location
option country DE
option state Berlin
option location Berlin
# Common name
option commonname OpenWrt
的php.ini
doc_root = "YOUR/DOCUMENT/ROOT"
cgi.force_redirect = 1
cgi.redirect_status_env = "yes";
答案 0 :(得分:0)
OpenWrt nginx软件包附带的默认nginx.conf只包含:
location / {
root html;
index index.html index.htm;
}
默认情况下,您的LUCI索引文件位于/www
下,因此请检查您的/etc/nginx/nginx.conf是否为correctly set到您的LUCI索引文件。
如果您的LUCI文件位于默认位置,那么您的nginx.conf
应包括:
location / {
root /www;
}
请勿忘记应用以下内容进行更改:nginx -s reload
答案 1 :(得分:0)
LuCI on Nginx is now possible,感谢LEDE论坛用户所做的工作。