File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ server {
2+ # ... your other server configurations ...
3+
4+ # Disable directory listing
5+ autoindex off;
6+
7+ # Option 1: To rewrite "www.domain.com -> domain.com"
8+ # if ($scheme = http) {
9+ # if ($host ~ ^www\.(.+)$) {
10+ # return 301 $scheme://$1$request_uri;
11+ # }
12+ # }
13+
14+ # Option 2: To rewrite "domain.com -> www.domain.com"
15+ # if ($scheme = http) {
16+ # if ($host !~ ^www\.) {
17+ # return 301 $scheme://www.$host$request_uri;
18+ # }
19+ # }
20+
21+ # Remove index.php from URL (if needed, adjust to your app's routing)
22+ # rewrite ^/index\.php(.*)$ $1 permanent;
23+
24+ # Pass Authorization header for PHP-FPM
25+ if ( $http_authorization != "" ) {
26+ set $auth $http_authorization ;
27+ }
28+
29+ location / {
30+ try_files $uri $uri / /index .php$is_args$args ;
31+ }
32+
33+ location ~ \.php$ {
34+ include snippets/fastcgi-php.conf; # Or your specific fastcgi configuration.
35+ fastcgi_param HTTP_AUTHORIZATION $auth ; #pass the auth header
36+ fastcgi_pass unix:/run/php/php-fpm.sock; # Or your PHP-FPM socket or port
37+ #fastcgi_pass 127.0.0.1:9000; #alternative tcp socket
38+ fastcgi_index index .php;
39+ include fastcgi_params;
40+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ;
41+ }
42+
43+ # ... your other location blocks ...
You can’t perform that action at this time.
0 commit comments