Is atleast being able to toggle PHP planned?

Before I apply this fix, I want to know more about what happens when I use a custom conf. If, for example, I set sub1.domain.com.conf to contain just a uSWGI proxy, will anything else, such as rewrite from http to https, also be set up? Or will it reset the entire local.conf block for that subdomain to contain just the uWSGI app?

Can this still work with the recent update on MIAB

This isn’t a supported feature and I continue to strongly advise against making modifications like this because enabling PHP like this could open your box up to serious security vulnerabilities if you’re not very careful. Websites should be hosted on a different server (and the Custom DNS page in the Mail-in-a-Box control panel can be used to make that possible).

4 Likes

Any new instructions on this? A lot has changed and paths dont align. I tried my best to follow along, but no luck

probably much easier to spin up another VPS to host your websites. $5 spent = not adding load to your mail server + security + less headache getting it set up.

No, Hosting PHP websites is not on the roadmap. Don’t expect this project to ever do so as it is simply not within the scope of the project.

I get that, but I’m sure someone has figured it out.

  1. I create a file named thanhnhua.vn.conf with follow content:

location / {
try_files $uri $uri/ /index.php;
fastcgi_index index.php;
fastcgi_pass php-fpm;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}

  1. Then move it to /home/user-data/www/thanhnhua.vn.conf
  2. Run /mailinabox/tools/web_update
  3. Run “sudo service nginx restart”

Everything works well.

I got PHP to work in v61.1 but images won’t display. I get 403 errors for the images. I made sure user-data [1000] is the owner of the files and folders.

I did have this working with v57 but I can’t remember how I did it.

What do I need to do to get images to display in v61.1? I’m only trying to edit the default landing page for my MIAB server by adding a little PHP and a couple of images.

UPDATE:
Adding a directory named ‘images’ and adding a location to the config file works:

location / {
try_files $uri $uri/ /index.php;
fastcgi_index index.php;
fastcgi_pass php-fpm;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location /images/ {
}