主页 > 知识库 > ThinkPHP 在阿里云上的nginx.config配置实例详解

ThinkPHP 在阿里云上的nginx.config配置实例详解

热门标签:深圳400电话办理那家好 百度地图标注饭店位置怎么 清远阳山400电话号码如何申请 施工地图标注怎么做 怎么在高德地图标注行走轨迹 襄阳房产电销机器人招商 百度地图标注名编辑 安徽移动外呼系统 个性化地图标注在线

具体代码如下所示:

# For more information on configuration, see:
#  * Official English Documentation: http://nginx.org/en/docs/
#  * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
  worker_connections 1024;
}
http {
  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 /var/log/nginx/access.log main;
  sendfile      on;
  tcp_nopush     on;
  tcp_nodelay     on;
  keepalive_timeout  65;
  types_hash_max_size 2048;
  include       /etc/nginx/mime.types;
  default_type    application/octet-stream;
  # Load modular configuration files from the /etc/nginx/conf.d directory.
  # See http://nginx.org/en/docs/ngx_core_module.html#include
  # for more information.
  include /etc/nginx/conf.d/*.conf;
  server {
    listen    80 default_server;
    listen    [::]:80 default_server;
    server_name _;
    root     /usr/share/nginx/html;
    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;
    location / {
       #try_files $uri $uri/ /index.php;
       root  /usr/share/nginx/html;
       index index.php index.html index.htm;
       if (!-e $request_filename) {  rewrite ^(.*)$ /index.php?s=$1 last;  break;  }
    }      
    # redirect server error pages to the static page /40x.html
    #
    error_page 404       /404.html;     
    location = /40x.html {
    }
    # redirect server error pages to the static page /50x.html
    #
    error_page  500 502 503 504 /50x.html; 
    location = /50x.html {
    }
    location ~ \.php$ {
    root      /usr/share/nginx/html;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include    fastcgi_params;
    }
    location ~ /\.ht {
    deny all;
    }
  }
}

总结

以上所述是小编给大家介绍的ThinkPHP 在阿里云上的nginx.config配置实例详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!

您可能感兴趣的文章:
  • Nginx服务器配置HTTPS nginx.config 配置文件(教程)
  • Nginx配置文件nginx.conf详细说明
  • Nginx配置文件(nginx.conf)配置详解(总结)
  • 详解Nginx服务器中的nginx.conf配置文件
  • Nginx配置文件nginx.conf的常用配置方法
  • 比较完整的Nginx配置文件nginx.conf常用参数中文详解
  • Nginx的nginx.conf配置文件中文注释说明
  • nginx配置文件nginx.conf中文注释说明
  • nginx从编译安装到配置文件说明中文详细介绍

标签:中卫 南昌 钦州 阜阳 临夏 延边 黑河 驻马店

巨人网络通讯声明:本文标题《ThinkPHP 在阿里云上的nginx.config配置实例详解》,本文关键词  ThinkPHP,在,阿里,云,上,的,;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 下面列出与本文章《ThinkPHP 在阿里云上的nginx.config配置实例详解》相关的同类信息!
  • 本页收集关于ThinkPHP 在阿里云上的nginx.config配置实例详解的相关信息资讯供网民参考!
  • 推荐文章