Welcome! Log In Create A New Profile

Advanced

A pretty URL for a specific PHP page?

Jore
September 06, 2021 01:00AM
Hi there,

Is it possible to make a pretty URL for a specific PHP page?

I'd like https://domain.com/report/ to render
https://domain.com/index.php?r=app%2Fform&id=2lyEsw

So I tried this location block, but I get 403 forbidden:

    location /report {
        index index.php?r=app%2Fform&id=2lyEsw;
        alias /var/www/easyforms;
    }



Here's my whole config:


server {
    listen       443 ssl http2;
    server_name  report.DOMAIN.COM;
    root /var/www/easyforms;
    gzip on;
    ssl_certificate /var/lib/acmesh/report.DOMAIN.COM/fullchain.cer;
    ssl_certificate_key
/var/lib/acmesh/report.DOMAIN.COM/report.DOMAIN.COM.key;
    ssl_protocols TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers
'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES12$
    ssl_session_cache shared:SSL:5m;
    ssl_session_timeout 10m;

    location /report {
        index index.php?r=app%2Fform&id=2lyEsw;
        alias /var/www/easyforms;
    }

    location / {
        index index.php index.html;
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi.conf;
        fastcgi_intercept_errors on;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_read_timeout 300s;
    }
}


What am I doing wrong?

Thanks!
Jore

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

A pretty URL for a specific PHP page?

Jore September 06, 2021 01:00AM

Re: A pretty URL for a specific PHP page?

Francis Daly September 10, 2021 05:32PM

Re: A pretty URL for a specific PHP page?

Jore September 11, 2021 07:52AM

Re: A pretty URL for a specific PHP page?

Александр Кириллов September 12, 2021 04:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready