centos nginx https 配置

1,如果想配置一个域名到指定目录咋弄呢?下面这个

server { listen 80; server_name 这里换成你的域名,例如baidu.com; set $root_path '/home/wwwroot/tapai_html/'; root $root_path; index index.html index.php index.htm; # rewrite ^(.*) https://$server_name; try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=http://www.likecs.com/$1; } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index /index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # location /imgtext_detail { # proxy_pass /home/wwwroot/tapai_html/imgtext_detail; # proxy_pass http://127.0.0.1:9000/imgtext_detail/; # } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root $root_path; } location ~ /\.ht { deny all; } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpfsyg.html