Search…

X3 Photo Gallery Support Forums

Search…
 
usairaq
Topic Author
Posts: 2
Joined: 16 Jun 2018, 05:51

Question about nginx

16 Jun 2018, 10:29

the X3 doesn't run correctly with my server and  the server is LNMP.
At the beginning after I installed X3, the page can't get the thumbnails.I checked the link of the thumbnails and it displayed "404 not found/nginx". then I got the .htaccess and link it to the nginx .conf file,an error occurred when I reload nginx.How does the .htaccess file work normally?

In the forum I found this guy's nginx configuration viewtopic.php?f=54&t=8617&p=41646&hilit=nginx#p37424
I upload it to my site and the thumbnail worked, but new problem appeared,no matter what I clicked which gallery at the homepage,it never changed,you must refresh the page manually then display the right thing.


I'm not good at websites. Many problems are solved by Google or somewhere,so I don't know if I have set the wrong way, or the X3 still not good at supporting nginx?How can the .htaccess file be used correctly?

yanjunling.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: Question about nginx

16 Jun 2018, 11:10

Hi. Nginx does NOT support .htaccess. Therefore, you need to configure X3 rewrite rules in your Nginx server config. I am not sure what rules you have there now, but I created an official X3 Nginx config example in the link below. It has been tested successfully by myself:
https://gist.github.com/mjau-mjau/6dc19 ... e566a8457b

The three important rules are inside the location / directive:
Code
  # X3 rewrite rules
  location / {
    if (!-e $request_filename){

      # Rewrite any calls to html|json|xml|atom|rss if a folder matching * exists
      rewrite (.+)\.(html|json|xml|atom|rss)$ $1/ last;

      # Rewrite any calls to /render to the X3 image resizer
      rewrite ^/render/. /app/parsers/slir/ last;

      # Rewrite routes to X3 application index.php if they are non-existent files/dirs
      rewrite ^(.*)$ /index.php?$1 last;
    }
  }
 
usairaq
Topic Author
Posts: 2
Joined: 16 Jun 2018, 05:51

Re: Question about nginx

16 Jun 2018, 12:43

Anyway, it's all right now.
thx