时间:2021-05-26
具体代码如下所示:
# 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配置实例详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
在上篇文章给大家介绍了在Nginx上部署ThinkPHP项目教程,今天给大家介绍nginx下thinkphp的配置,具体详解如下:##domainredirec
nginxlocation匹配实例详解例1、nginx配置:例2、nginx配置:例3、nginx配置:感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
概述在上一篇文章Nginx配置Thinkphp支持URLRewrite中已经介绍了如何配置Nginx支持ThinkPHP的URLRewrite,但是上文针对的是
本文实例讲述了thinkphp配置连接数据库的常用方法,分享给大家供大家参考。具体方法如下:1.在thinkphp入口文件同目录下的config.inc.php
Nginx多站点配置实例详解在一台VPS上,我们有时候需要同时跑几个virtualenv。比如virtualenvapp1跑的是Django的一个应用,而vir