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

Configure custom nginx error page for QA/test/vpn-only sites #60

Closed
rlskoeser opened this issue Mar 23, 2021 · 3 comments · Fixed by pulibrary/princeton_ansible#4179
Closed
Assignees
Labels
chore A task that doesn't require points tracking 🚧 maintenance Upkeep tasks and fixes

Comments

@rlskoeser
Copy link
Contributor

rlskoeser commented Mar 23, 2021

Everyone occasionally forgets to log into access test/vpn sites, and it would be helpful to have a different visual reminder to distinguish those sites from library sites.

  • remind to login to vpn if not already on campus / on vpn
  • add cdh logo somewhere
  • should return a 401 not authorized if access is denied due to IP address

Instructions from Francis:

at the bottom of every config generally is

server {
    listen 443 ssl;
    server_name cdh-geniza.princeton.edu;
    ...
    include /etc/nginx/conf.d/templates/prod-maintenance.conf;
}

and the contents of prod-maintenance

error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 429 431 451 500 501 502 503 504 505 506 507 508 510 511 = @maintenance;
location @maintenance {
        root /var/local/www/default;
        try_files $uri /index.html =502;
    }

And the html file is the error page displayed.

@rlskoeser rlskoeser added the 🚧 maintenance Upkeep tasks and fixes label Mar 23, 2021
@acozine
Copy link
Collaborator

acozine commented Aug 7, 2023

If a staging site has proxy_intercept_errors set to on, nginx currently returns a 403 Forbidden error code when the client is connecting from off-campus and not on the VPN.

@acozine
Copy link
Collaborator

acozine commented Aug 9, 2023

Related to pulibrary/princeton_ansible#4122.

@rlskoeser
Copy link
Contributor Author

hooray! thank you @acozine

@rlskoeser rlskoeser added the chore A task that doesn't require points tracking label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task that doesn't require points tracking 🚧 maintenance Upkeep tasks and fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants