Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:16:46+00:00 2026-06-14T07:16:46+00:00

I want to make certain pages of my site available only by https. I

  • 0

I want to make certain pages of my site available only by https. I think it would be ok to recognize protocol right in the page.erl and then redirect to
the right URL. Something like

case Protocol of
    http -> wf:redirect('https://' ++ UrlWithNoProtocol);
    _ -> ok
end

Of course I can get Protocol and UrlWithNoProtocol simply splitting URL by “://”. But the thing is, I have no idea: how to get an full URL of page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:16:48+00:00Added an answer on June 14, 2026 at 7:16 am

    My response on the Nitrogen Mailing list, duplicated here due to the nice markdownish formatting:

    I would do this one of two ways, and both of them mean putting Nitrogen behind a reverse proxy like Nginx.

    The first way would be to have simple rewrite rules in nginx that force SSL for certain pages. For example, in nginx, if you wanted to redirect all requests that start with /admin to be over HTTPS, you could do this in your HTTP section.

    location ^~ /admin {
         rewrite ^ https://$http_host$request_uri? permanent;
    }
    

    You can read about configuring nginx to run over SSL at (all the way at the bottom): https://github.com/nitrogen/nitrogen_core/blob/master/doc/org-mode/config.org

    The next alternative would be to (once again) put nitrogen behind a reverse proxy, but this time, check for the existence of a header indicating that the request is secure (this header would be inserted by nginx).

    For example, you could add a rule in your ‘ssl’ section in your nginx configuration that sets a header like:

    proxy_set_header X-Forwarded-SSL on;
    

    Then you could check for the existence of the header with wf:header(x_forwarded_ssl).

    If you’re not using a reverse proxy, then the easiest check is probably to check which port the site is being served with by getting the request, then the socket port

    Req = wf_context:request_bridge(),
    Port = Req:peer_port().
    

    Then, the check is simply if the Port is 80, it’s http, if it 443, then it’s https.

    Personally, I’d opt for the nginx solution, since with any degree of scaling, it’d be nice to simply scale out by adding additional servers and letting nginx do the load balancing and ssl handling for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make certain areas of my website accessible to browser users only,
Hello i want to make a site that will have a registration page a
i have certain pages in my website that i would like to only be
I want to make sure all getters of the classes in a certain package
Let's say I want make some of my sources publicly available via my blog
Does anybody know of a way to make jQuery Mobile load only on pages
On a Linux, Apache, PHP site, I need to make certain that a subdirectory
I want to use Varnish to cache certain pages even in the presence of
I have an ASP.NET web site. I want a user to make a decision
I'm trying to open multiple pages following a certain format using mechanize. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.