Comparez les prix des domaines et des services informatiques des vendeurs du monde entier

Comment convertir l'emplacement écrasant Nginx dans Apache

J'ai un site web qui a fonctionné en utilisant nginx, Mais maintenant c'est apache. J'essaie de transformer nginx dans apache Et sans succès.

Ce fichier nginx, que je veux convertir en 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 [url=http://appwrx;]http://appwrx;[/url]
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;
}
}

J'ai essayé d'utiliser des passages proxy et RewriteBase, Mais il semble que rien ne fonctionne. Ceci est mon fichier Apache, C'est tout ce que je comprends encore:

 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=""></directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all



ProxyPass /api [url=http://localhost:8010/api]http://localhost:8010/api[/url]
ProxyPassReverse /api [url=http://localhost:8010/api]http://localhost:8010/api[/url]


</virtualhost>
Invité:

Pour répondre aux questions, connectez-vous ou registre