![]() |
|
|
#1 |
|
Member
Регистрация: 27.08.2015
Сообщений: 54
Вес репутации: 0 ![]() ![]() ![]() ![]() ![]() ![]() |
имеются пару доменов на dot.tk
запросы идут через dns afraid.org далее nginx обрабатывает по имени хоста и назначает папку для каждого из этих сайтов. пример кода Код:
# 1 site2
server {
listen 80; # Port, make sure it is not in conflict with another http daemon.
server_name site1.tk; # Change this, reference -> http://nginx.org/en/docs/http/server_names.html
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 32k;
fastcgi_buffers 4 32k;
fastcgi_busy_buffers_size 32k;
fastcgi_temp_file_write_size 32k;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 60; # 60 sec should be enough, if experiencing a lot of timeouts, increase this.
output_buffers 1 32k;
postpone_output 1460;
root /mnt/www/site1; # Your document root, where all public material is.
location ~ \.php$ {
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (-f $request_filename) {
# Only throw it at PHP-FPM if the file exists (prevents some PHP exploits)
fastcgi_pass 127.0.0.1:1026; # The upstream determined above
}
}
}
# 2 site2
server {
listen 80; # Port, make sure it is not in conflict with another http daemon.
server_name site2.tk; # Change this, reference -> http://nginx.org/en/docs/http/server_names.html
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 32k;
fastcgi_buffers 4 32k;
fastcgi_busy_buffers_size 32k;
fastcgi_temp_file_write_size 32k;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 60; # 60 sec should be enough, if experiencing a lot of timeouts, increase this.
output_buffers 1 32k;
postpone_output 1460;
root /mnt/www/site2; # Your document root, where all public material is.
location ~ \.php$ {
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (-f $request_filename) {
# Only throw it at PHP-FPM if the file exists (prevents some PHP exploits)
fastcgi_pass 127.0.0.1:1026; # The upstream determined above
}
}
}
пример открываеться сайт site3.tk afraid направляет запрос на ип роутера nginx определяет имя сервера (server_name) и nginx если определил site3.tk переправляет на локальный адрес сеси (192.168.1.10) |
|
|
|
| Здесь присутствуют: 1 (пользователей: 0 , гостей: 1) | |
|
|