Score:0

how to setting nginx extension wildcard

yt flag

i want to hiding my extension like .php

but it's not only to hiding, if i enter the index.do nginx rewrite to index.php but, url address must be the same (index.do)

In summary, what I specifically want is

example.com/index.jsp,
example.com/index.html,
example.com/index.asp,
example.com/index.js,
example.com/index.do,
example.com/indexanystring[]~?&/^,
example.com/index

All must be rewritten to index.php. Additionally, the address must remain the same.

If entered as "example.com/indexanystring" url should be "example.com/indexanystring" and index.php should be visible

One of the sites I've seen seems to use nginx to implement that functionality. I think it's good from a security point of view, so I'm going to give it a try.

Below is the nginx config I tried

...
        location / {
                    try_files $uri $uri/ @rewrite;
        }
    
        location @rewrite {
                    rewrite ^ $uri.php last;
        }
    
        location ~ /roulette/index(.*)$  {
                    rewrite ^ $uri/index.php;
        }
    
        location ~ \.php$ {
                    include snippets/fastcgi-php.conf;
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    #fastcgi_pass 127.0.0.1:9000;
                    fastcgi_pass unix:/run/php/php5.6-fpm.sock;
                    include fastcgi_params;
        }
...

but it doesn't work as i want

Score:0
yt flag

i solved it myself.

here is my setting

rewrite ^/index.* /index.php break;

but, i don't know about it is safe.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.