location / {        root   /usr/share/nginx/html;        index  index.html index.htm;        if (!-e $request_filename) { &nb
原创 2015-10-20 13:43:26
732阅读
站点配置文件server   {       listen 80;       server_name  localhost 222.78.4.90;   &n
原创 2013-08-28 08:50:27
897阅读
直接记录配置如下 user  www; worker_processes  1; events {     worker_connections  1024; } http {     include   &n
原创 2015-07-10 14:50:04
497阅读
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections ...
转载 2018-10-12 13:29:00
232阅读
2评论
Nginx支持thinkphp pathinfo模式
原创 2014-07-29 10:31:49
636阅读
最近一个项目中使用了ThinkPHP做为开发框架,URL上我们使用了PATHINFO模式,但是Nginx默认是不支持PATHINFO的,需要进行手动配置才可以,于是我们按照了以下方法进行了Nginx的PATHINFO支持配置: 修改nginx.conf,找到server中的 location ~ .php${},修改为location ~ .php {},并在其中增加以下内容: set $pa...
转载 2016-12-13 16:06:00
226阅读
2评论
​Thinkphp框架,Lnmp环境,访问http://localhost/thinkphp/index.php/Home时出现404,nginx默认不支持Thinkphp
原创 2017-02-11 00:47:01
1391阅读
server {listen  80;server_name     apply.lalagome.cn;root /usr/local/www/gome;error_page  404 500 502 503 504  /50x.html;index index.html index.htm index.php ;locati
原创 2015-03-11 14:12:47
735阅读
ThinkPHP支持通过PATHINFO和URL rewrite的方式来提供友好的URL,只需要在配置文件中设置 'URL_MODEL' => 2 即可。在Apache下只需要开启mod_rewrite模块就可以正常访问了,但是Nginx中默认是不支持PATHINFO的,这使得用TP写程序变的非常有局限性。所以我们需要修改nginx.conf文件。   网上搜了很多方法都不
原创 2011-07-06 15:32:34
405阅读
Nginx配置虚拟主机】 每一个 server { listen 80; server_name www.a.com; ..... } 就表示一台虚拟域名, 然后对应的,在 /etc/hosts 修改: vim /etc/hosts 【/usr/local/server/nginx/conf/ng
转载 2016-10-24 19:55:00
98阅读
2评论
打开文件:  /usr/local/nginx/conf/nginx.conf 把下面两个类似文件放到/usr/local/nginx/conf/文件夹中 1_www.baidu.com_bundle.crt; 2_   server {         listen&nb
原创 2017-10-24 16:58:31
2427阅读
ThinkPHP支持通过PATHINFO和URL rewrite的方式来提供友好的URL,只需要在配置文件中设置 'URL_MODEL' => 2 即可。在Apache下只需要开启mod_rewrite模块就可以正常访问了,但是Nginx中默认是不支持PATHINFO的,所以我们需要修改nginx.conf文件。网上搜了很多方法都不奏效,研究了一天,发现通过以下的配置可以完美
原创 2013-05-21 01:18:29
773阅读
server {   ...      location / {          index  index.htm index.html 
转载 2017-11-06 13:19:46
501阅读
thinkphpnginx下pathinfo支持在apache下运行正常,但是在nginx下内页都是404空白。解决办法:首先:修改nginx的rewritelocation / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }然后:项目配置下url模式改为2'URL_MODEL'
原创 2013-11-28 09:12:28
1055阅读
Nginx设置伪静态支持THINKPHP框架的PATHINFO方法
原创 2013-02-03 15:52:18
4789阅读
1评论
thinkphp5在nginx环境下运行的时候默认是不支持通过index.php/index/index/index的形式去访问的,也不支持route,所以需要手动配置nginx使其支持。apache默认支持修改nginx配置文件找到你的thinkphp站点配置项,在其中的php项中如同下面配置windowslocation~\.php(.*)${fastcgi_pass127.0.0.1:90
原创 2019-08-28 13:25:06
1250阅读
多个入口访问官方可以访问,访问后台就不行了,需要配置多入口 listen 80; server_name 172.30.164.199; index index.php index.html index.htm default.php default.htm default.html login.p
原创 2021-10-18 16:03:10
327阅读
尝试了好多次,总算找到可以用的配置文件了,记录下server { listen 80; server_name thinkphp.lo; root /var/www; index index.html index.htm index.php; error_page 404 /404.html; locat...
原创 2022-03-01 10:49:07
1078阅读
对应站点设置中,可修改访问网站的目录,修改nginx对应站点配置文件新增下面代码,即可完成重写路由,增加index.phplocation / {
原创 2022-06-06 17:49:33
2784阅读
尝试了好多次,总算找到可以用的配置文件了,记录下server { listen 80; server_name thinkphp.lo; root /var/www; index index.html index.htm index.php; error_page 404 /404.html; locat...
原创 2021-07-12 10:16:21
384阅读
  • 1
  • 2
  • 3
  • 4
  • 5