What works:
- I can go to all the pages defined in the dashboard. I developed theme and setup all the pages locally then upload them to the server.
- All the page links works.
- I can go to /dashboard and login and see the dashboard.
What doesn't work:
- Once I logged in, on the dashboard page, I am getting a lot of 404 error in the browser console. Anything has https://buzz.inxeption.com/dashboard?ajax= will give me the error. See screenshot.
![404 errors][1]
- On dashboard page, the the top row where it should say cache setting, debugg setting and update buttons are stuck in loading, see screenshot below.
- Go to any page and try to edit them will give you a page not found error.
- If you are logged in and you go to a page and try the edit in page, it'll give a page not found error there as well.
In fastcgi_params, we have
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
In fastcgi.confi, we have
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
In the nginx.conf, we have
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
server_tokens off;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header "X-XSS-Protection" "1; mode=block";
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' https: wss:; script-src 'self'
'unsafe-inline' 'unsafe-eval' https: wss:; img-src 'self' 'unsafe-inline' 'unsafe-eval' https: wss: * data:";
add_header Strict-Transport-Security max-age=31536000;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml
application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf
font/opentype image/svg+xml image/x-icon;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Then in the /etc/nginx/sites-enabled, we have:
ssl_stapling on;
ssl_stapling_verify on;
server {
if ($host = abc.def.com) {
return 301 https://$host$request_uri;
}
listen 80 default_server;
root /var/www/html/automad/;
server_name abc.def.com;
}
server {
server_name abc.def.com;
ssl on;
listen 443 ssl;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate /etc/ssl/def.com-com.pem;
ssl_certificate_key /etc/ssl/def-com.key;
root /var/www/html/automad/;
index index.php index.html;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$request_uri;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
[1]: