A
A
aramtop2018-02-06 20:57:33
Nginx
aramtop, 2018-02-06 20:57:33

Did I correctly convert .htaccess to nginx config?

Hello! Switched to nginx.
There is a .htacces file:

### BEGIN - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ###
<IfModule mod_rewrite.c>
RewriteEngine on

# RewriteBase is set to "/" so rules do not need updating if the
# installation directory is relocated.  It is imperative that
# there is also a RewriteCond rule later that can effectively get
# the actual value by comparison against the request URI.
# 
# If there are _any_ other RewriteBase directives in this file,
# the last entry will take precedence!
RewriteBase /

# Redirect directories to an address with slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$  $1/ [R]

# Send all remaining (routable paths) through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Determine and use the actual base
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2index.php [QSA,L]
</IfModule>
### END - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ###

Help! You need to translate it into the nginx config. If through the converter, then check, I'm a beginner, I won't notice an error :(
The nginx config itself:
server {
    listen      185.211.246.85:80;
    server_name bill.serversllc.com ;
    root        /home/admin/web/bill.serversllc.com/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/bill.serversllc.com.log combined;
    access_log  /var/log/nginx/domains/bill.serversllc.com.bytes bytes;
    error_log   /var/log/nginx/domains/bill.serversllc.com.error.log error;


    location / {

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    127.0.0.1:9001;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   /home/admin/web/bill.serversllc.com/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   /home/admin/web/bill.serversllc.com/stats/;
        include /home/admin/conf/web/bill.serversllc.com.auth*;
    }


    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     /home/admin/conf/web/nginx.bill.serversllc.com.conf*;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-02-07
@shambler81

https://ruhighload.com/post/%D0%A3%D1%81%D1%82%D0%...
https://www.howtoforge.com/tutorial/how-to-install...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question