Como faço para converter as reescritas de localização do Nginx para o Apache?

3

Eu tenho um site que estava rodando usando o nginx, mas agora está o apache Estou tentando converter o nginx para o apache e não tive sucesso

Este é o arquivo nginx que eu quero converter para o apache:

server {
    listen                      80;
    listen                      443 ssl http2;
    include                     ssl.conf;
    include                     upload2.conf;
    ssl_certificate             /srv/config/ssl/wrx.org-combined.crt;
    ssl_certificate_key         /srv/config/ssl/wrx.org.key;
    ssl_trusted_certificate     /srv/config/ssl/_bundle_digicert_ev.crt;

    server_name                 wrx
                                wrx.*
                                .wrx.org;
    root                        /srv/sites/wrx/web;

    if ($http_host = www.wrx.org) {
        rewrite ^              $scheme://wrx.org$request_uri permanent;
    }

    include                     debug.conf;
    include                     robots.conf;

    location /api {
        try_files               $uri @api;
    }

    location /give {
        try_files               $uri @api;
    }

    location /forgot {
        try_files               $uri @api;
    }

    location / {
        set $script_name        /index.php;
        try_files               $uri $uri.html $uri/index.html @php;
        location ~* \.(?>js|css|svg|png|jpg|jpeg|gif|mp4|mov|m4v|ico|woff2?|ttf|eot)$ {
            # Directives to send expires headers and turn off 404 error logging.
            expires             30d;
            log_not_found       off;
            try_files           $uri @api;
        }
    }

    location ^~ /media/videos {
        expires                 30d;
        more_set_headers        "Content-Type: video/mp4";
    }

    # Do not allow .php to be used in the URL (/chat will allow it)
    location ~ \.php$ {
        internal;
        return 404;
    }

    # Node.js API
    location @api {
        proxy_pass              http://appwrx;
        proxy_cache             off;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        Host $http_host;
    }

    # CI main/dashboard
    location @php {
        # If $uri.php is a valid PHP file, we use that
        if (-e $request_filename.php) {
            set $script_name    $uri.php;
        }
        include                 php.conf;
        fastcgi_cache           off;
        fastcgi_pass            $php_upstream;
    }
}

Eu tentei usar passes de proxy e RewriteBase, mas nada parece estar funcionando Este é o meu arquivo Apache, isso é tudo que eu descobri até agora:

 Include /etc/phpmyadmin/apache.conf

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        RewriteEngine on

        ErrorLog ${APACHE_LOG_DIR}/error.log

        CustomLog ${APACHE_LOG_DIR}/access.log combined

         <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>


        ProxyPass /api http://localhost:8010/api
        ProxyPassReverse /api http://localhost:8010/api


</VirtualHost>
    
por Tsea 29.08.2016 / 17:20

0 respostas