Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:34:58+00:00 2026-06-13T19:34:58+00:00

Can somebody shine a light? This is the issue: I need to create a

  • 0

Can somebody shine a light?
This is the issue: I need to create a site on a server that runs Nginx. I have no experience with this server, so I have been sticking my nose in it.
I want to omit the index.php, so that

http://www.mydomain.com/index.php/welcome/index

becomes

http://www.mydomain.com/welcome/index

I then want to extract the /welcome/index so I can start and play with that in the MVC application. I have been looking around, but I get lost in the club of people that are likely doing their own configurations.

My question is if I can influence the server response as a client, like it is done with Apache through the htaccess file, or do I need to involve the provider who is hosting the server? I have requested to alter the server for this, but the support I get is not very helpful.

I was able to simulate the required server response within the nginx.conf file. This tells me that it can be done.
For those interested. Read the values on the url through $_SERVER[‘REQUEST_URI’].

worker_processes  1;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        location / {
            root   html;
            index  index.php index.html index.htm;


           try_files $uri $uri/ /index.php;

        }

                include mime.types;


        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }


    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:34:59+00:00Added an answer on June 13, 2026 at 7:34 pm

    I do it like this:

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

    And then you access the URI with $_GET['uri'] from your index.php. You should take a look at nginx’s try_files documentation.

    Or if you want to access it via $_SERVER['REQUEST_URI'] do it like this:

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

    Edit:

    A few things just looking at your server conf:

    • You’ve already included mime.types in the http block, so there is no need to include them again in the server block

    • Probably a good idea to move root html; and index index.php... up to your server block

    • Definitely read through these sample configurations (everything explained in the comments), very good way to start getting the hang of nginx conf

    • Nginx website has some really good resources

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is baffling me, maybe somebody can shine the light of education on my
Can somebody suggest me a good and light c# IoC container that works in
Can somebody explain to me what this does in javascript? (function (x,y){}(x,y)); or this
Can somebody help me with this. There is HTML code: <h3> <label> <input type=checkbox
Can somebody tell me what's wrong with that piece of code : NSString* plistPath
Can somebody shed some light for me on how SubSonic 3.x handle concurrency? I
Can somebody provide a working example of JavaScriptResult in asp.net mvc. I understand that
Can somebody put a regex expression that will: find a chunk that starts with
Can somebody help me convert this VB function to Perl (PHP, Ruby or Python
Can somebody explain how DefaultIfEmpty() can be used in LINQ . I have ready

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.