我有一个使用nginx运行的网站,但现在它是apache我试图将nginx转换为apache,并没有成功
这是我想转换为Apache的nginx文件:
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; } }
我已经尝试使用代理通行证和RewriteBase,但似乎没有工作这是我的Apache文件这是我到目前为止的想法:
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>