Answer the question
In order to leave comments, you need to log in
How to set up nginx.conf for a single site on an open server?
You need to configure the nginx.conf file to redirect all requests to one file. How to do this when using open server?
Answer the question
In order to leave comments, you need to log in
Use the virtual host configuration template in the desired domain folder to create a custom domain configuration. When creating/changing a file, a server restart is required. The configuration template for the desired module can be found in the ./userdata/config/ folder.
For example, if you want to create your own configuration for the xxx.ru domain for the Apache-2.4.2 module, then copy the ./userdata/config/Apache-2.4.3_vhost.conf file to the folder with the desired domain, edit this file to suit your needs and restart server.
Or another example, when using the Apache + Nginx module, you can copy both configuration files for each server to the domain folder: Apache-2.2.23+Nginx-1.2.4_vhosta.conf and Apache-2.2.23+Nginx-1.2.4_vhostn.conf.
Please note - when editing the host configuration, you cannot delete or replace the %...% system variables, you can only make new entries that complement the configuration.
Source: Open Server Documentation > FAQ > How do I create my own host configuration for a domain?
https://ospanel.io/docs/#voprosy-i-answer
For example here. tweak to taste.
server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name mysite.local;
root /path/to/basic/web;
index index.php;
access_log /path/to/basic/log/access.log;
error_log /path/to/basic/log/error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~* /\. {
deny all;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question