sirfpsycho
Please provide which URLs you visit in the browser will trigger which URL rewriting, I think it can be handled by location

    2 months later

    Help. I need to install mine, but I need to rewrite the mod on my server by running the panel. My developer said that I need to put this in the nginx rules. How to do in aapanel?

    `#######################################################################

    Full /etc/nginx/sites-available/default file example below:

    #######################################################################
    server {
    listen 80;
    server_name localhost; # change this for your server
    root /usr/share/nginx/html;
    index index.php;
    client_max_body_size 5G;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    
    location / {
        if (!-e $request_filename) {
                rewrite ^/(.*) /index.php?_page_url=$1 last;
        }
    }
    
    location /files/ {
        internal;
    }
    
    # these locations would be hidden by .htaccess normally
    location /logs/ {
        deny all;
    }
    
    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    }`

      aaPanel_Jose
      Please, is urgent. The script what i will install is Yetishare file host

      Help. I need to install mine, but I need to rewrite the mod on my server by running the panel. My developer said that I need to put this in the nginx rules. How to do in aapanel?

      `#######################################################################

      Full /etc/nginx/sites-available/default file example below:

      #######################################################################
      server {
      listen 80;
      server_name localhost; # change this for your server
      root /usr/share/nginx/html;
      index index.php;
      client_max_body_size 5G;

      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      location ~ \.php$ {
          if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
          include        fastcgi_params;
      }
      
      location / {
          if (!-e $request_filename) {
                  rewrite ^/(.*) /index.php?_page_url=$1 last;
          }
      }
      
      location /files/ {
          internal;
      }
      
      # these locations would be hidden by .htaccess normally
      location /logs/ {
          deny all;
      }
      
      location ~* "/\.(htaccess|htpasswd)$" {
          deny    all;
          return  404;
      }

      }`

      inliadev
      click on website>nginx url rewrite and select your cms, if it is not listed then select 0 and paste your rewrite code in the box and save.

        sirfpsycho

        I chose the following path:

        After adding my domain, when I click on the website, I can see all the information on my website.

        On the right side, I click on CONF and the configuration appears on the site, so I go where URL REWRITE appears empty. I try to paste the code there, when saving, it shows a red error.

          When I use the verification method to see if there are any functions that are not enabled on my website. I found that only the url rewrite is not active. see the image

          • JAY replied to this.

            inliadev
            but what the role of aapanel, you need to contact your script developer to fix them by converting.

              JAY

              Perhaps you did not understand my doubt.

              The script comes with good documentation.

              the script also comes with nginx rules in a .txt file and is well explained where you can apply the rules.

              My doubt is related to where to put the rules, that's all.

              I already have the nginx rules for the script. But I don't have to apache.

              When I install the apache server on the aapanel, I have problems configuring mod_rewrite on apache

              when i install nginx server on the panel, i also have problems configuring mod_rewrite.

              I do not know which server to use: I DO NOT KNOW IF I USE APACHE OR NGINX, but for both, mod_rewrite is not working for me.

              you need to paste you rules under website.. example of my site nginx rules..

                inliadev try to paste only this part
                location / {
                if (!-e $request_filename) {
                rewrite ^/(.*) /index.php?_page_url=$1 last;
                }
                }
                location /files/ {
                internal;
                }
                location /logs/ {
                deny all;
                }

                  JAY

                  Hi, I already used this procedure of yours, but it doesn't work either.

                  Hi, I already used this procedure of yours, but it doesn't work either.

                  I still don't know how to solve this. I think I should stop using this panel.

                  The developers believe that there is no solution to help me.

                  I say this because they see it, that is my messages here on the forum. But until today I have no solution.

                  In addition, the site is sometimes inaccessible

                  which script are you using yeti or imagesharing
                  try litespeed.

                  2 years later

                  sirfpsycho
                  -----------------------------------
                  location ~ /public/ {
                  }
                  location / {
                  if ($http_host !~ "www."){
                  rewrite .*$ http://www.$http_host/$1 redirect;
                  }
                  rewrite .*$ https://$http_host$request_uri redirect;
                  rewrite .*$ /public/$1 break;
                  }