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

Force HTTPS configuration for sites #303

Open
saeedvaziry opened this issue Oct 3, 2024 Discussed in #275 · 1 comment
Open

Force HTTPS configuration for sites #303

saeedvaziry opened this issue Oct 3, 2024 Discussed in #275 · 1 comment
Assignees
Labels
feature New feature or request
Milestone

Comments

@saeedvaziry
Copy link
Member

Discussed in #275

Originally posted by agustinzamar August 14, 2024
I already deploployed a site and created a ssl certificate for it. How can I force redirect to https site when the user access to http? I tried manually updating the vhost but if there are any changes it will get reset I believe

@saeedvaziry saeedvaziry added the feature New feature or request label Oct 3, 2024
@saeedvaziry saeedvaziry added this to the v2 milestone Oct 3, 2024
@saeedvaziry saeedvaziry self-assigned this Oct 3, 2024
@ShaniHakir
Copy link

Discussed in #275

Originally posted by agustinzamar August 14, 2024 I already deploployed a site and created a ssl certificate for it. How can I force redirect to https site when the user access to http? I tried manually updating the vhost but if there are any changes it will get reset I believe

I noticed that you are setting up port 80 and 443 in the same server block in nginx: app/SSH/Services/Webserver/scripts/nginx/php-vhost-ssl.conf

but for the redirect to work you need to make separate block for port 80, and then if port 80 is called issue a redirect to 443, like this

server {
    listen 80;
    server_name **domain** **aliases**;
    return 301 https://$server_name$request_uri;
}

# HTTPS server block
server {
    listen 443 ssl;
    ........etc
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants