我在安装某个不知名的CMS,然后安装时提示我需要配置nginx的URL重写并提供了文档和规则,但是请问如何将这段规则写入宝塔的伪静态,文档提供的规则如下:
- <pre tabindex="0"><code>server {
- listen 80;
- server_name example.com;
- root /var/www/azuriom/public;
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Content-Type-Options "nosniff";
- add_header Referrer-Policy "strict-origin-when-cross-origin";
- index index.html index.htm index.php;
- charset utf-8;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location = /favicon.ico { access_log off; log_not_found off; }
- location = /robots.txt { access_log off; log_not_found off; }
- error_page 404 /index.php;
- location ~ \.php$ {
- fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~ /\.(?!well-known).* {
- deny all;
- }
- }</code></pre>
复制代码 文档里还在下方提示了:This configuration must be placed in a site in site-available and not in thenginx.conf.
请问我该如何把这段规则写入伪静态?谢谢
使用的是php8.2
|
|