Ich möchte einige der nicht so wichtigen Inhaltsseiten von Wordpress für meine Laravel App zeigen.Wordpress in Laravel Öffentlicher Ordner
Ich habe Wordpress in public/pages
Ordner meiner Laravel-Anwendung installiert.
Das Problem, mit dem ich konfrontiert bin, ist jedoch, dass hübsche Links (laravel.app/pages/sample-page) 404 werfen, da sie von Laravel behandelt werden.
Wie kann ich das beheben? Ich gehe davon aus, dass es auf Nginx-Konfigurationsdatei behandelt werden muss.
Die Website auf Laravel Forge präsentiert, und hier ist die nginx Konfigurationsdatei:
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/laravel.app/before/*;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name .laravel.app;
root /home/forge/laravel.app/public;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/laravel.app/264952/server.crt;
ssl_certificate_key /etc/nginx/ssl/laravel.app/264952/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'xxx';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/laravel.app/server/*;
location/{
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/laravel.app-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/laravel.app/after/*;
Vielen Dank im Voraus.