Nginx konfiguracja obs

Potrzebujesz pomocy z C, C++, perl, python, itp.
tabbi
Posty: 2
Rejestracja: 18 lipca 2011, 02:35

Nginx konfiguracja obsługi wieloznaczników

Post autor: tabbi »

Witam.

M
ęczę się bardzo z konfiguracją obsługi wieloznaczników w nginksie. Ogólnie PHP działa jako fastcgi z PHP-FPM. Cały wynik jaki chcę osiągnąć to po wpisaniu np.:

Kod: Zaznacz cały

konto.domena.pl
wywołał się skrypt na stronie głównej w głównym katalogu index.php?/profil/index/$host (gdzie $host to konto w moim przypadku).

Utworzyłem osobny blok:

Kod: Zaznacz cały

server {
        listen [::]:80;
        server_name *.twojadomena.pl;
        root /home/e/public_html;
        access_log /home/e/logs/access.log;
        error_log /home/e/logs/error.log;
        error_page 400 402 403 404   /home/e/errors_html/40x.html;
        error_page  500 502 503 504  /home/e/errors_html/50x.html;
        index index.html index.php index.htm;


        location = /home/e/errors_html/50x.html {
                        internal;
        }


        location = /home/e/errors_html/40x.html {
                        internal;
        }


        location ~ /\.ht {
                deny  all;
        }


        location / {
             try_files $uri $uri/ /index.php?/profil/index/$host;
             location ~* \.php$ {


             if ($uri !~ "^/ftp/")
             {
                                fastcgi_pass   127.0.0.1:9000;
             }
                        fastcgi_split_path_info ^(.+\.php)(.*)$;
                        fastcgi_index  index.php;
                        include fastcgi_params;
                        fastcgi_param  PATH_INFO $document_uri;
                        fastcgi_param  SCRIPT_FILENAME  $request_filename;
                        error_page  404   /home/e/errors_html/404.html;
            }


        }


}

Czy ktoś pomoże albo nakieruje na rozwiązanie?
fnmirk
Senior Member
Posty: 8321
Rejestracja: 03 grudnia 2007, 06:37

Post autor: fnmirk »

ODPOWIEDZ