Joel Mutete
Joel Mutete

Reputation: 11

the wordpress admin page does not work with my nginx configuration

I installed Wordpress and my site in the /var/www/html/guce directory; and when I put root on my nginx configuration the wp-admin admin page does not work, when root is put on /var/www/html; It works correctly but the problem is that I can only access the home page of my site, all other links give 404 not found. with the first root, therefore /var/www/html/guce; all links work correctly, except the wp-admin page. thank you for helping me

it's my nginx configuration

server {
    listen 80;
    server_name ikar.dev www.ikar.dev;

    # Rediriger automatiquement tout trafic HTTP vers HTTPS
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name ikar.dev www.ikar.dev;
    root /var/www/html;

    ssl_certificate /etc/letsencrypt/live/ikar.dev/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ikar.dev/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    client_max_body_size 50M;
    proxy_read_timeout 1200;
    proxy_send_timeout 1200;
    add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
    index index.php index.html index.htm;
  location /nginx_status {
    stub_status on;
    access_log off;
    allow 192.81.216.136;
    deny all;
}
# Bloc spécifique pour wp-admin



#gestion de CSS dans /guce

 location ~ /\.ht {
        deny all;
    }
location / {
        try_files $uri $uri/ /index.php?$args;
    }
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
allow all;
error_log /var/log/nginx/guce_error.log debug;
access_log /var/log/nginx/guce_access.log;
}
}

Upvotes: 1

Views: 27

Answers (0)

Related Questions