Previous server was running on Apache but now i have switched to Nginx. It's all working great except i don't know how to convert this Apache line in to my working nginx config
SetEnvIf Host "^([^\.]+)\.my-shop\.dev$" MY_ENV=$1
What it needs to do is, that it needs to read the fist "param/subdomain/something" and set is as environment variable
So far i'm trying to achieve this by doing something like this, but it's not working
server {
listen 80 ;
server_name $\.my-shop\.dev;
location ~* \.php$ {
try_files $uri $uri/ /index.php?q=&$args;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param MY_ENV $1;
}
}
If you need any additional informations please let me know and i will provide. Thank you!