Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view without password - nginx #4

Closed
Aaron-Online opened this issue Apr 19, 2020 · 4 comments
Closed

view without password - nginx #4

Aaron-Online opened this issue Apr 19, 2020 · 4 comments

Comments

@Aaron-Online
Copy link

When I click view without password , the browser doesn't show any content. I am using Nginx.

@Aaron-Online
Copy link
Author

X1YQ_4}@CNTB`XEOAPP6AFP

@eonegh
Copy link

eonegh commented Dec 24, 2020

When I click view without password , the browser doesn't show any content. I am using Nginx.

You should change your "nginx.conf", the ".htaccess" doesn’t work for Nginx, so add configs following:

location / {
    if ($query_string ~ "^view") {
        rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /view.php?note=$1 last;
    }
    if ($query_string ~ "^simple") {
        rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /simple.php?note=$1 last;
    }
    rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /index.php?note=$1 last;
   }
}
add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";

@Aaron-Online
Copy link
Author

When I click view without password , the browser doesn't show any content. I am using Nginx.

You should change your "nginx.conf", the ".htaccess" doesn’t work for Nginx, so add configs following:

location / {
    if ($query_string ~ "^view") {
        rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /view.php?note=$1 last;
    }
    if ($query_string ~ "^simple") {
        rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /simple.php?note=$1 last;
    }
    rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /index.php?note=$1 last;
   }
}
add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";

I tried and it works perfect. Thank you for your reply

@domOrielton domOrielton pinned this issue Dec 30, 2020
@domOrielton
Copy link
Owner

Thanks both for the fix and for testing. I've pinned this issue, added the example from @eonegh into the project and readme. I don't have an nginx setup to test on so if you have anything else useful to add for nginx then please let me know and I will add it in to the project.

Thanks, Dom

@domOrielton domOrielton changed the title view without password view without password - nginx Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants