找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1956|回复: 4

老毛子固件ONMP自动覆盖NGINX配置怎么办?

[复制链接]
发表于 2019-6-25 18:12 | 显示全部楼层 |阅读模式
NGINX不支持THINKPHP,不能访问资源文件,修改NGINX配置文件后重启自动变回默认的怎么办呢!
我的恩山、我的无线 The best wifi forum is right here.
发表于 2019-6-25 18:52 | 显示全部楼层
本帖最后由 IDSSC 于 2019-6-25 18:57 编辑

点打开默认主页,把THINKPHP的配置写在/opt/etc/nginx/vhost/default.conf最后即可
  1. server {
  2.     listen 81;
  3.     server_name localhost;
  4.     root /opt/wwwroot/default/;
  5.     index index.html index.htm index.php tz.php;
  6.     include /opt/etc/nginx/conf/php-fpm.conf;
  7.     #otherconf
  8. }
  9. server {
  10.     listen 87;
  11.     server_name localhost;
  12.     root /opt/wwwroot/thinkphp/;
  13.     index  index.html  index.php;
  14.     include /opt/etc/nginx/conf/php-fpm.conf;
  15.     #otherconf
  16. }
复制代码



点评

就这这个/opt/etc/nginx/vhost/default.conf修改后保存重启服务后还变成默认的,直接修改\opt\etc\nginx\nginx.conf这个配置还不会生效  详情 回复 发表于 2019-6-25 20:05
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-6-25 20:05 | 显示全部楼层
IDSSC 发表于 2019-6-25 18:52
点打开默认主页,把THINKPHP的配置写在/opt/etc/nginx/vhost/default.conf最后即可

就这这个/opt/etc/nginx/vhost/default.conf修改后保存重启服务后还变成默认的,直接修改\opt\etc\nginx\nginx.conf这个配置还不会生效

点评

那就把/opt/wwwroot/default/tz.php删掉,把thinkphp复制到/opt/wwwroot/default/  详情 回复 发表于 2019-6-26 01:53
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-26 01:53 | 显示全部楼层
lghuai1 发表于 2019-6-25 20:05
就这这个/opt/etc/nginx/vhost/default.conf修改后保存重启服务后还变成默认的,直接修改\opt\etc\nginx\ ...

那就把/opt/wwwroot/default/tz.php删掉,把thinkphp复制到/opt/wwwroot/default/
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-6-26 09:22 | 显示全部楼层
修改\\192.168.123.1\AiCard_01\opt\wwwroot\default\application\config.php
  1.     // 兼容PATH_INFO获取
  2.     'pathinfo_fetch'         => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL', 'REQUEST_URI'],
复制代码


\\192.168.123.1\AiCard_01\opt\etc\nginx\nginx.conf修改()vhosth目录下会自动覆盖,把引用去掉直接写到这个配置里,以后再开服务记得把配置加进来

  1. user admin root;
  2. pid /opt/var/run/nginx.pid;
  3. worker_processes auto;

  4. events {
  5.     use epoll;
  6.     multi_accept on;
  7.     worker_connections 1024;
  8. }

  9. http {
  10.     charset utf-8;
  11.     include mime.types;
  12.     default_type application/octet-stream;
  13.    
  14.     sendfile on;
  15.     tcp_nopush on;
  16.     tcp_nodelay on;
  17.     keepalive_timeout 60;
  18.    
  19.     client_max_body_size 2000m;
  20.     client_body_temp_path /opt/tmp/;
  21.    
  22.     gzip on;
  23.     gzip_vary on;
  24.     gzip_proxied any;
  25.     gzip_min_length 1k;
  26.     gzip_buffers 4 8k;
  27.     gzip_comp_level 2;
  28.     gzip_disable "msie6";
  29.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
  30.         server {
  31.     listen 81;
  32.     server_name localhost;
  33.     root /opt/wwwroot/default/public/;
  34.     #index index.html index.htm index.php tz.php;
  35.     include /opt/etc/nginx/conf/php-fpm.conf;
  36.                 location / {
  37.             index  index.html index.htm index.php l.php;
  38.            autoindex  off;
  39.         }

  40.         #error_page  404              /404.html;

  41.         # redirect server error pages to the static page /50x.html
  42.         #
  43.         error_page   500 502 503 504  /50x.html;
  44.         location = /50x.html {
  45.             root   "D:/phpStudy/WWW/public";
  46.         }

  47.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  48.         #
  49.         #location ~ \.php$ {
  50.         #    proxy_pass   http://127.0.0.1;
  51.         #}

  52.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  53.         #
  54.         location ~ \.php(.*)$  {
  55.             fastcgi_pass   127.0.0.1:9000;
  56.             fastcgi_index  index.php;
  57.             fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
  58.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  59.             fastcgi_param  PATH_INFO  $fastcgi_path_info;
  60.             fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
  61.             include        fastcgi_params;
  62.         }
  63.     #otherconf
  64.         }
  65.         server {
  66.     listen 88;
  67.     server_name localhost;
  68.     root /opt/wwwroot/Kodexplorer/;
  69.     index index.html index.htm index.php tz.php;
  70.     include /opt/etc/nginx/conf/php-fpm.conf;
  71.     #otherconf
  72.         }

  73.     #include /opt/etc/nginx/vhost/*.conf;
  74. }
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 16:35

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表