[GH-ISSUE #77] SSL support #56

Closed
opened 2026-02-26 09:35:28 +03:00 by kerem · 3 comments
Owner

Originally created by @chrisb86 on GitHub (Mar 30, 2014).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/77

I would like to see SSL support.

I don't run my server in my local network and transmitting data unencrypted is something I don't want. If I configure nginx to rewrite all requests to https, neither the scripts, css etc. nor the images are loaded so vimbadmin is nearly unusable.

Please add an option to force SSL connections and rewrite the links and asset urls to https. #SSL #HTTPS

Originally created by @chrisb86 on GitHub (Mar 30, 2014). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/77 I would like to see SSL support. I don't run my server in my local network and transmitting data unencrypted is something I don't want. If I configure nginx to rewrite all requests to https, neither the scripts, css etc. nor the images are loaded so vimbadmin is nearly unusable. Please add an option to force SSL connections and rewrite the links and asset urls to https. #SSL #HTTPS
kerem closed this issue 2026-02-26 09:35:28 +03:00
Author
Owner

@barryo commented on GitHub (Mar 31, 2014):

I would like to see SSL support.

More for people who stumble on this ticket and think ViMbAdmin has no SSL support: generally speaking, SSL support has nothing to do with ViMbAdmin and everything to do with your web browser.

SSL just works on Apache. If the request comes in via a URL beginning https:// then all URLs are created likewise. Apache just needs a redirect on non-SSL requests such as:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^/(.*)$ https://www.example.com/$1 [L,R]

This is all handled by:

https://github.com/opensolutions/OSS-Framework/blob/master/src/OSS/Utils.php#L194

You'll note here that it keys off $_SERVER['HTTP_HOST'] - I'm not sure how this translates to nginx?

An alternate option to the above dynamic / just works on Apache is to set the host option in the application/configs/application.ini file such as:

utils.genurl.host_mode = 'REPLACE'
utils.genurl.host_replace = 'https://www.example.com'

As this is not a ViMbAdmin issue, I'm closing this ticket but:

  • please update to let us know if the above worked;
  • if there is nginx specific code that should be in the above referenced function, please also let us know or open a pull request against it.
<!-- gh-comment-id:39056702 --> @barryo commented on GitHub (Mar 31, 2014): > I would like to see SSL support. More for people who stumble on this ticket and think ViMbAdmin has no SSL support: generally speaking, SSL support has nothing to do with ViMbAdmin and everything to do with your web browser. SSL _just works_ on Apache. If the request comes in via a URL beginning `https://` then all URLs are created likewise. Apache just needs a redirect on non-SSL requests such as: ``` RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^/(.*)$ https://www.example.com/$1 [L,R] ``` This is all handled by: https://github.com/opensolutions/OSS-Framework/blob/master/src/OSS/Utils.php#L194 You'll note here that it keys off `$_SERVER['HTTP_HOST']` - I'm not sure how this translates to nginx? An alternate option to the above dynamic / just works on Apache is to set the host option in the `application/configs/application.ini` file such as: ``` ini utils.genurl.host_mode = 'REPLACE' utils.genurl.host_replace = 'https://www.example.com' ``` As this is not a ViMbAdmin issue, I'm closing this ticket but: - please update to let us know if the above worked; - if there is nginx specific code that should be in the above referenced function, please also let us know or open a pull request against it.
Author
Owner

@chrisb86 commented on GitHub (Mar 31, 2014):

utils.genurl.host_mode = 'REPLACE'
utils.genurl.host_replace = 'https://www.example.com'

This did the job.

It was no problem to rewrite the URLs to https. But the scripts, images and css files URLs weren't rewritten. It works now.

This is what I use in my nginx config.

if ($scheme = http) {
    return 301 https://$server_name$request_uri;
}

Thank you!

<!-- gh-comment-id:39121207 --> @chrisb86 commented on GitHub (Mar 31, 2014): ``` utils.genurl.host_mode = 'REPLACE' utils.genurl.host_replace = 'https://www.example.com' ``` This did the job. It was no problem to rewrite the URLs to https. But the scripts, images and css files URLs weren't rewritten. It works now. This is what I use in my nginx config. ``` if ($scheme = http) { return 301 https://$server_name$request_uri; } ``` Thank you!
Author
Owner

@barryo commented on GitHub (Apr 19, 2014):

Thanks for the feedback. I added a page to the documentation on this:

https://github.com/opensolutions/ViMbAdmin/wiki/SSL-Support

<!-- gh-comment-id:40865592 --> @barryo commented on GitHub (Apr 19, 2014): Thanks for the feedback. I added a page to the documentation on this: https://github.com/opensolutions/ViMbAdmin/wiki/SSL-Support
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#56
No description provided.