server { listen 80; server_name xxxxx; root "/www/public"; location / { index index.html index.htm index.php; if (-f $request_filename/index.html){ rewrite (.) $1/index.html break; } #if (-f $request_filename/index.php){ # rewrite (.) $1/index.p…
转自:linux nginx配置新项目加域名 找到nginx的配置文件 nginx/nginx.conf 第一种方,法直接在nginx.com里面配置 user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that…
我们现在拥有2个项目.但是只有一个域名,通过nginx配置来实现以下url导向不同的项目. 后台管理台:{域名}/admin 用户客户端:{域名}/client server { listen 8888; server_name ****.*****.com; root /home/work/***/static/client; index index.html; autoindex on; charset utf-8; location ~ /(system|car)/ { proxy_set…
找到nginx的配置文件 nginx/nginx.conf 第一种方,法直接在nginx.com里面配置 user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this…
1.首先看了nginx报错日志 报 signal process started signal process started表示还有 产生原因 1.可能你的nginx.conf 内容配置的有问题. 2../nginx -r reload 启动命令默认加载的nginx.conf 的路径不对. 之前还以为本地安装的nignx端口号冲突了呢,结果不是 是配置的问题; 假如mac安装的nignx和集成环境mamp端口号重复了, 可以修改配置文件nginx.conf中端口号来解决 也可以停掉你不需要的那…
目前前端项目 可分两种: 多页面应用,单页面应用. 单页面应用 入口是一个html文件,页面路由由js控制,动态往html页面插入DOM. 多页面应用 是由多个html文件组成,浏览器访问的是对应服务器的html文件. 多页面应用 目录结构 . ├── README.md ├── html ├── index.html └── project.html └── img └── bg.jpg 上面这种情况 index.html 不在根目录下,nginx.conf 需要配置更加准确. nginx配置…
最近一段时间一直研究CI框架,但是对CI框架的跳转链接一直需要加index.php前缀,经过CI论坛的各种解决方案,最后总结记录一下自己实际操作去掉index.php的过程. 1.要修改Apache 的配置文件,让Apache支持rewrite_module,修改过程如下:打开apache的配置文,conf/httpd.conf :LoadModule rewrite_module modules/mod_rewrite.so,把该行前的#去掉. 2.搜索 AllowOverride None…
第一步:将public目录下的index.php移到和public同级目录下,[或者直接在public同级目录下新建一个index.php] 第二步:那么这个新的index.php文件的内容如下: <?php// +----------------------------------------------------------------------// | ThinkPHP [ WE CAN DO IT JUST THINK ]// +---------------------------…
需求:地址 http://testa/inlinePreview/live.html?id=463738305721405440重定向到 http://testb/shares/live.html?newsId=463738305721405440 break; nginx配置:在testa的nginx中配置if ($request_uri = /inlinePreview/live.html?id=463738305721405440){ rewrite ^ http://testb/shar…
坑一: nginx配置必须改成伪静态配置 否则出现nginx 403 forbiddem错误 坑2: 缓存目录权限必须开放 坑3:服务器权限准备: 坑4:防火墙关闭 systemctl stop firewalld.service 关闭防火墙…