|
发表于 2021-4-7 20:01:00
|
显示全部楼层
本帖最后由 aRNoLD 于 2021-4-7 20:02 编辑
- server {
- listen 443 ssl http2; 假设用HTTPS而不是HTTP,80到443的转向就不管了,网上很多
- server_name phpbb.com; 假设域名是phpbb.com
- root /var/www/phpbb.com; 假设路径和目录如此
- index index.php;
- location / {
- index index.php index.html;
- try_files $uri $uri/ @rewriteapp;
-
- }
- location @rewriteapp {
- rewrite ^(.*)$ /app.php/$1 last;
- }
- location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
- deny all;
- internal;
- }
- location ~ \.php(/|$) {
- if (!-f $document_root$fastcgi_script_name) {
- return 404;
- }
- include fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_index index.php;
- try_files $uri $uri/ /app.php$is_args$args;
- fastcgi_pass php-handler;
- }
- location /install/ {
- try_files $uri $uri/ @rewrite_installapp;
-
- location ~ \.php(/|$) {
- include fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- try_files $uri $uri/ /install/app.php$is_args$args;
- fastcgi_pass php-handler;
- }
- }
- location @rewrite_installapp {
- rewrite ^(.*)$ /install/app.php/$1 last;
- }
- access_log /var/www/wwwlogs/phpbb.log; 假设日志文件名和路径如此
- error_log /var/www/wwwlogs/phpbb.error.log error;
- upstream php-handler {
- server 127.0.0.1:9000; 这里根据实际情况改,不走TCP走SOCK的话,用unix:/这样的
- }
复制代码 |
|