Welcome to Centmin Mod Community
Register Now

Nginx rewrite nginx conf

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by alohapapa, Aug 13, 2017.

  1. alohapapa

    alohapapa New Member

    3
    1
    3
    May 2, 2017
    Ratings:
    +1
    Local Time:
    10:39 AM
    Hi all
    i need help.

    i need rewrite this config to nginx, i tried but getting error a lot by nginx -t cmd:

    location ~ ^([^.\?]*[^/])$ {
    try_files $uri @addslash;
    }

    location @addslash {
    return 301 $uri/;
    }

    location /admin {
    try_files $uri $uri/ /admin/index.php?$query_string;

    }

    location / {
    try_files $uri $uri/ /index.php?$query_string;

    }
    anyone can help me insert this code to rewrite rule please
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,634
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,308
    Local Time:
    1:39 PM
    Nginx 1.13.x
    MariaDB 5.5
    Moved your thread to a more appropriate forum.

    For posting code you might want to use CODE tags for code How to use forum BBCODE code tags :)

    what is the error from running
    Code (Text):
    nginx -t
    
     
  3. alohapapa

    alohapapa New Member

    3
    1
    3
    May 2, 2017
    Ratings:
    +1
    Local Time:
    10:39 AM
    Thank you so much Eva, i think it fixed. Because i insert nginx conf to domain.conf and getting error then i tried insert to staticfiles.conf and it working like a charm without any problem

    Code:
    nano /usr/local/nginx/conf/staticfiles.conf
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,634
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,308
    Local Time:
    1:39 PM
    Nginx 1.13.x
    MariaDB 5.5