remark42
remark42 copied to clipboard
Error on demo page without subdomain
I installed Remark42 without subdomain everything works fine, but the demo page has problems. The error lies in the absence of a proxy directory in the address domain.com/remark/web/last-comments.html You can see the errors here - https://smarthdd.com/remark/web/
Most likely related to your web server config (like Nginx), can you please share it? It seems like the URL which gives 404 is handled by the wrong rule.
user nginx;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 8192;
error_log /var/log/nginx/error.log warn;
events {worker_connections 4096;}
http {
server_tokens off;
sendfile on;
tcp_nopush on;
include /etc/nginx/mime.types;
charset UTF-8;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_tickets on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
ssl_stapling on;
ssl_stapling_verify on;
ssl_buffer_size 4k;
ssl_early_data on;
resolver 1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4;
resolver_timeout 2s;
access_log off;
log_not_found off;
gzip_vary on;
gzip_proxied any;
server {
listen 80;
listen [::]:80;
server_name smarthdd.com www.smarthdd.com;
return 301 https://smarthdd.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include my-conf/smarthdd-ssl-certificates.conf;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
server_name www.smarthdd.com;
return 301 https://smarthdd.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include my-conf/smarthdd-ssl-certificates.conf;
root /var/www/smarthdd.com/html;
server_name smarthdd.com;
access_log /var/log/nginx/smarthdd.com.log;
error_page 404 /404.htm;
location =/404.htm {etag off;}
gzip_static on;
rewrite (.*).gz$ $1 permanent;
index index.htm;
if ($request_uri ~ ^(.*/)index.htm$) {return 301 $1;}
rewrite ^/en/(.*) /$1 permanent;
location ~ \.(?:png|jpg|ico|cur)$ {add_header Cache-Control "public, max-age=31536000, immutable";}
location ~ \.exe$ {add_header Cache-Control no-cache;}
location ~ \.htm$ {
add_header Cache-Control no-cache;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header Content-Security-Policy "script-src 'strict-dynamic' 'nonce-mihPp2tZLqfwlptpYr4dZw==' 'unsafe-inline' https:; object-src 'none'; base-uri 'none'; report-uri https://hcode.report-uri.com/r/d/csp/enforce";
}
location =/version.txt {add_header Cache-Control no-cache;}
location =/robots.txt {add_header Cache-Control "public, max-age=604800"; add_header X-Robots-Tag noindex;}
location =/sitemap.xml {add_header Cache-Control no-cache; add_header X-Robots-Tag noindex;}
location ^~ /remark/ {
gzip_static off;
gzip on;
gzip_types text/plain application/json text/css application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
proxy_max_temp_file_size 0;
rewrite /remark/(.*) /$1 break;
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
Please move remark regexp above all others, as the first regexp hit ends the lookup: so HTML page is handled by other location in your case, which doesn't find the file and gives 404.
I tried it and as expected it didn’t bring any results. This is not the problem at all. The problem is that the file is requested from the wrong location - domain.com/web/last-comments.html vs domain.com/remark/web/last-comments.html
My apologies for the misdiagnosis, then it's likely something related to frontend, @akellbl4 likely will be able to help.
Yes, it's related to paths on fronted. Because it's disregarding remark_config.host for that URLs.
@Ivan-Chupin can you please verify if the issue is still present in the master version of Remark42?
@paskal Unfortunately, I am unable to compile the master version to test.
If you're using binary and not Docker, you can use Docker even on your laptop to get the binary.
git clone https://github.com/umputun/remark42.git && cd remark42 && make release - after running that command, you'll have binaries for all platforms in directory ./remark42/bin:
~/Desktop/remark42: ls bin
remark42.darwin-amd64.tar.gz
remark42.darwin-arm64.tar.gz
remark42.freebsd-amd64.tar.gz
remark42.linux-386.tar.gz
remark42.linux-amd64.tar.gz
remark42.linux-arm64.tar.gz
remark42.windows-amd64.zip
@paskal I don't have a Linux home computer and my tiny VPS doesn't have enough resources. Can you give me a direct link to the compiled master version of remark42.linux-amd64.tar.gz?
Here is it, the version from the current master: remark42.linux-amd64.tar.gz
The master version does not fix this error. You can see the result here.
@Ivan-Chupin I went over the thread another time and this time I wanted to understand what result you want to achieve. Probably working demo page isn't your goal. What is the goal then? (or it is?)
Personally, this error doesn't bother me. I just pointed out its presence. Perhaps this error can cause other errors.
The critical error that does not allow me to switch to new versions is another error.
As a result of this error, I have to roll back from the master version to the old version 1.9.0