...
if (env('APP_ENV') === 'production') {
URL::forceScheme('https');
$this->app->make(Request::class)->server->set('HTTPS', true);
}
...
# 301 редирект со страниц со слешем на страницы без слеша в конце URL
rewrite ^/(.*)/$ /$1 permanent;
server {
listen 80;
server_name 192.168.1.121;
charset utf8;
error_log /game/nginx/log/error.log;
access_log /game/nginx/log/access.log main;
#root /game/public;
location /deberc {
root /game/public;
index index.html index.htm;
}
location / {
root /game/public;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /game/public;
}
}
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# 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/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
}
server {
listen 80;
server_name localhost;
location /itest {
proxy_pass http://192.168.1.121;
}
location /qtest {
proxy_pass http://192.168.1.122;
}
location /ztest {
proxy_pass http://192.168.1.123;
}
}