A pretty URL for a specific PHP page?

Jore community at thoughtmaybe.com
Mon Sep 6 04:58:37 UTC 2021

Hi there,

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

I'd like https://domain.com/report/ to render

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_protocols TLSv1.2;
    ssl_prefer_server_ciphers on;
    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?


More information about the nginx mailing list