Score:0

Nginx not loading usernames

cn flag

Good day, on my site users, can create usernames for their profiles but every time they try to visit their usernames on the browser to shows a 404 page, and on top of that it does not show the defined 404 while at it. For example;

domain.com/username DOES NOT LOAD
domain.com/@username LOADS PROPERLY (and if the username does not exist it shows defined 404.)

Below is the snippet of the block;

  if (!-e $request_filename){
    rewrite ^/password-reset/([^\/]+)(\/|)$ /index.php?link1=welcome&link2=password_reset&user_id=$1;
  }
  rewrite ^/$ /index.php?link1=home;
  rewrite "^/forum/members/([a-zA-Z]{0,1})(/?|)$" /index.php?link1=forum-members-byname&char=$1;
  if (!-e $request_filename){
    rewrite ^/setting/([A-Za-z0-9_]+)/([A-Za-z0-9_-]+)$ /index.php?link1=setting&user=$1&page=$2;
    rewrite ^/setting/([A-Za-z0-9_-]+)$ /index.php?link1=setting&page=$1;
    rewrite ^/setting$ /index.php?link1=setting;
  }
  if (!-e $request_filename){
    rewrite ^/@([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1;
  }
  if (!-e $request_filename){
    rewrite ^/([A-Za-z0-9_]+)/([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1&type=$2;
  }
  if (!-e $request_filename){
    rewrite ^/([^\/]+)(\/|)$ /index.php?link1=timeline&u=$1;
  }
}

location /nodejs {
  deny all;
}```
Henry Newman avatar
cn flag
**I trailed the the error and got this;** ```2021/12/14 22:06:13 [error] 92611#92611: *92140 open() "/var/www/website/username" failed (2: No such file or directory), client: 123.321.213.312, server: domain.com, request: "GET /username HTTP/1.1", host: "domain.com"```
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.