Skip to content

Instantly share code, notes, and snippets.

@mypapit
Created April 28, 2023 02:15
Show Gist options
  • Select an option

  • Save mypapit/41b396f317ed11b88079e96ad5d0c5b2 to your computer and use it in GitHub Desktop.

Select an option

Save mypapit/41b396f317ed11b88079e96ad5d0c5b2 to your computer and use it in GitHub Desktop.
How to run OJS 3 on Apache HTTPD behind nginx reverse proxy smoothly
# Mohammad Hafiz bin Ismail <[email protected]>
# blog.mypapit.net
# this is for Ubuntu/Debian Apache server config
#/etc/apache2/sites-available/your-ojs.conf
<VirtualHost *:9080>
ServerAdmin [email protected]
ServerName ojs-site.example.com
ServerAlias ojs-site.com
DocumentRoot /mnt/websites/ojs/public_html
#add this line -- this is essential!!
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
<Directory /mnt/websites/ojs/public_html/>
Options FollowSymlinks
AllowOverride All
Require all granted
Allow from all
</Directory>
</VirtualHost>
@asidibe1
Copy link

Thank you for the share. The small code work also alone in a .htaccess file in the ojs root folder. This avoid to change your apache conf file.

Just SetEnvIf X-Forwarded-Proto "https" HTTPS=on in a .htaccess file

@mypapit
Copy link
Author

mypapit commented Sep 2, 2024

Thank you for the share. The small code work also alone in a .htaccess file in the ojs root folder. This avoid to change your apache conf file.

Just SetEnvIf X-Forwarded-Proto "https" HTTPS=on in a .htaccess file

great!, thanks for the tips 😸😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment