Wordpress live site pages return 404 error nginx php-fpm
<p>I have a wordpress site with the permalinks set to post name. All the pages do not appear and return a 404 except for the index. If I set this to plain, then they appear, but many resources are missing, and I'm not sure why.</p>

<p>So just to be clear, if permalink is plain, it works but then there are many errors as there is a 404 on multiple files (except on the index).
If permalink is postname then the entire page is a 404.</p>

<p>Here is my htaccess file, my nginx config, and my php-fpm config.
Can anyone see the problem?</p>

<pre><code># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
# END WordPress
</code></pre>

<p>NGINX CONF</p>

<pre><code>server {
    listen 80;
    server_name www.example.com example.com;
    root /var/www/example;
    return 301 https://$server_name$request_uri;
}   

server {
    listen       443 ssl;
    server_name  www.example.com example.com;
    root   /var/www/example;
    index index.php;
    ssl_certificate /etc/nginx/ssl/example.com/example.com.crt;
    ssl_certificate_key /etc/nginx/ssl/example.com/example.com.key;

    access_log  /var/log/nginx/example.log main;
    error_log  /var/log/nginx/example_error.log;

    location / {
        root   /var/www/example;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

}
</code></pre>

<p>PHP-FPM</p>

<pre><code>[example]
listen = 127.0.0.1:9001
listen.allowed_clients = 127.0.0.1
user = nginx
group = nginx
...and some more I don't think is relevant but I can supply if asked for.
</code></pre>

<p>Thank you for all your help!</p>