--- title: "Nginx_tp5_conf" date: 2024-01-04T14:26:56+07:00 draft: true --- # nginx config with thinkPHP5.x ```shell server { listen 80; server_name _.com; root /home/web/tp5root/public; access_log /var/log/access.log; error_log /var/log/error.log; location / { index index.php index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } location ~ .*\.(html|txt|sql|log)$ { return 403; } location ~ \.php$ { index index.php; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ```