Custom HTTPD for pleroma and matrix? Where did PHP install to?

HelloEveryone

New member
Joined
Oct 4, 2021
Messages
1
Ok, so I have been through a bunch of the documentation on how to add custom values to the nginx.conf, but I just cannot figure it out. I migrated a couple web apps from an old server to a new one, and I wanted to be able to use directadmin. However, I cannot for the life of me figure out how to make the things I'm trying to do work with it.

I am running an instance of pleroma, and an instance of matrix on the same domain. I have copy/pasted from the nginx.conf from my old server, and into the auto generated nginx.conf in my users directory.

I need my config file to have all of these values, and I am not quite sure how to use the templates, or even if it's possible to use the templates and the tokens to generate a file with these values.

I've been using a workaround which consists of a service that starts a minute after my system boots, and then replaces the auto generated nginx.conf file with the one that I edited and added all of these values listed below manually. (ip changed and domain changed for displaying here).

proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
inactive=720m use_temp_path=off;

proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
inactive=720m use_temp_path=off;

#################


All of the default server blocks here generated by directadmin.
#################
server
{
listen 192.168.1.1:443 ssl http2;
server_name mydomain.com www.mydomain.com ;
ssl_certificate /usr/local/directadmin/data/users/admin/domains/mydomain.com.cert.combined;
ssl_certificate_key /usr/local/directadmin/data/users/admin/domains/mydomain.com.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers off;
# In case of an old server with an OpenSSL version of 1.0.2 or below,
# leave only prime256v1 or comment out the following line.
ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1;
ssl_stapling on;
ssl_stapling_verify on;

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml;

# the nginx default is 1m, not enough for large media uploads
client_max_body_size 16m;
ignore_invalid_headers off;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location / {
proxy_pass http://phoenix;
}
location ~ ^/(media|proxy) {
proxy_cache pleroma_media_cache;
slice 1m;
proxy_cache_key $host$uri$is_args$args$slice_range;
proxy_set_header Range $slice_range;
proxy_cache_valid 200 206 301 304 1h;
proxy_cache_lock on;
proxy_ignore_client_abort on;
proxy_buffering on;
chunked_transfer_encoding on;
proxy_pass http://phoenix;
}
location /api/fedsocket/v1 {
proxy_request_buffering off;
proxy_pass http://phoenix/api/fedsocket/v1;
}
location /_synapse {
proxy_pass http://127.0.0.1:8008;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /_matrix {
proxy_pass http://127.0.0.1:8008;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /.well-known/matrix/server {
return 200 '{"m.server": ":443"}';
add_header Content-Type application/json;
}
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://mydomain.com"},"m.identity_server": {"base_url": "https://vector.im"}}';
add_header Content-Type application/json;
add_header "Access-Control-Allow-Origin" *;
}

}

Continuing this way would be perfectly fine to me, as I'm the only user that'll be ever editing this particular domain, except I just went to setup a demo wordpress site, on a subdomain of the domain that needs all these custom values, and I cannot for the life of me, figure out how to make php74 work through the config files.

I've tried all of the usual things, like adding the following...

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}

I've also noticed that there is nothing in the /etc/php folder at all..

I've also checked out the nginx_php.conf file, and was expecting to see something there, but it's just a blank file with a small indentation at the top.

So, can anyone please help explain how can I either use the php that was installed with DirectAdmin manually, by editing the file and auto replacing it as i've been doing, or to input the above values through the DirectAdmin interface?

Thank you for your time.
 
Top