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 8287375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:01:03+00:00 2026-06-08T12:01:03+00:00

I would like to deploy lithium on nginx server, however there are configurations provided

  • 0

I would like to deploy lithium on nginx server, however there are configurations provided only for Apache and IIS.
I’ve successfully written several nginx server configurations for various applications in past, but I’m struggling with this one.

Already asked this question on nginx and lithium forums, no luck.

This is best of what I’ve made so far.

root /var/servers/my_app/app/webroot;

location / {
    index index.php;
    try_files $uri $uri/ index.php;
}
location ~ \.php {
            fastcgi_pass unix:/tmp/php.socket;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /var/servers/my_app/$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
    }

Problem is on / (root page) every link gets index.php prepended, e.g. instead of

www.example.com/something

I get

www.example.com/index.php/something

Not sure if this even is nginx configuration related or rather something, that lithium does when it cannot detect Apache/IIS environment. Either way I cannot solve it.

Another thing, that when I access “www.example.com/test” (via direct URL input), the page renders correctly, however “www.example.com/test/” (with trailing slash) and “www.example.com/test/anything_here” is broken – all links gets appended to current URL e.g. pressing the same link creates this:

www.example.com/test/
www.example.com/test/test
www.example.com/test/test/test

EDIT: Updated configuration
(Sorry for much delayed edit, but I’m still stuck and recently restarted solving this)

    root /var/server/my_app/app/webroot/;

    index index.php index.html;
    try_files $uri $uri/ /index.php?$args;

    location ~ \.php {
            fastcgi_pass unix:/tmp/php.socket;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /var/servers/my_app/$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
    }

    location ~/\.ht {
            deny all;
    }

}

As I mentioned in comments this now causes all links to have index.php included, it looks like:

www.example.com/index.php/something
www.example.com/index.php/stylesheet.css
  • 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-08T12:01:04+00:00Added an answer on June 8, 2026 at 12:01 pm

    As I suspected the problem was that Lithium relies on some environment variables, in this case – link generation, it uses PHP_SELF, which happened to be incorrect.

    Solution:

    fastcgi_param PATH_INFO $fastcgi_path_info;
    

    Instead of previously incorrect:

    fastcgi_param PATH_INFO $fastcgi_script_name;
    

    So final configuration:

    root /var/server/my_app/app/webroot/;
    
    index index.php index.html;
    try_files $uri $uri/ /index.php?$args;
    
    location ~ \.php {
            fastcgi_pass unix:/tmp/php.socket;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /var/servers/my_app$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
    }
    
    location ~/\.ht {
            deny all;
    }
    

    Thanks to rmarscher and mehlah @ lithum forums.

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

Sidebar

Related Questions

I would like to deploy a private cloud using Ubuntu Server 9.10. There is
I would like to deploy snapshot builds from Bamboo to Artifactory. My repository's Handle
I would like to try out Capistrano to deploy a PHP application but can't
I would like to know practically what kind of Assemblies should I deploy in
I'm trying to deploy a site generated with Jekyll and would like to keep
I would like to deploy two separate Django applications to Heroku. Two applications, with
We would like to deploy an application via ClickOnce but you really do need
I'm developing an app that I would like to deploy for iPhone 3.0, iPhone
I am trying to deploy a WAR on the mentioned tomcat application server. However
I would really like to deploy my project using jquery but afraid it may

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.