By cwhisperer
What is the correct virtual host configuration for a Zend Framework 3 application on Ubuntu 18.04 with Nginx? Here mine:
server {
listen 80;
listen [::]:80;
server_name dev.myapp.local;
root /var/www/NetBeansProjects/myapp/public;
index index.php index.html;
location / {
try_files $uri $uri/ @php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location @php {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/NetBeansProjects/myapp/public/index.php;
include fastcgi_params;
}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
What you could do is first to deploy a LEMP instance using this 1-click installation here:
https://marketplace.digitalocean.com/apps/lemp
This will ship with an Nginx server block that should work for most PHP frameworks so you would not really have to make any changes.
Alternatively, you can use the one from the official docs here:
https://www.nginx.com/resources/wiki/start/topics/recipes/zend/
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.