nginx -T
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /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;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# 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/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
# configuration file /etc/nginx/mime.types:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/font-woff woff;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
ostal / 502 Bad Gateway nginx/1.10.3 (Ubuntu),
не стартует nginx
tail -f /var/log/nginx/error.log
2019/07/28 07:03:01 [error] 1363#1363: *62 connect() failed (111: Connection refused) while connecting to upstream, client: 141.8.183.17, server: postal.yourdomain.com, request: "GET /catalog/upakovka_i_khranenie/shkatulki_dlya_nozhey/ HTTP/1.1",
upstream: "127.0.0.1:5000/catalog/upakovka_i_khranenie/shkatu...", host: "damassk.ru"
server {
listen [::]:80;
listen 0.0.0.0:80;
server_name _; #postal.domayn.ru;
return 301 https://$host$request_uri;
}
server {
listen [::]:443 ssl;
listen 0.0.0.0:443 ssl;
root /opt/postal/app/public;
server_name _; #postal.domayn.ru;
ssl_certificate ssl/postal.cert;
ssl_certificate_key ssl/postal.key;
# Generate using: openssl dhparam 4096 -out /etc/ssl/dhparam.pem
# ssl_dhparam /etc/ssl/dhparam.pem;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
location / {
client_max_body_size 50M;
try_files $uri $uri/index.html $uri.html @puma;
}
location /assets {
add_header Cache-Control max-age=3600;
}
location @puma {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://127.0.0.1:5000;
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /opt/postal/config;
postal.yml index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80 ;
listen [::]:80 ;
root /opt/postal/config;
postal postal.yml index index.html index.htm index.nginx-debian.html;
server_name postal.domayn.ru; # managed by Certbot
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/postal.domayn.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/postal.domayn.ru/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
netstat -ntlp | grep LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 729/nginx -g daemon
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 743/epmd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 630/sshd
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 1126/[postal] web.1
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 928/beam
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 911/mysqld
tcp6 0 0 :::80 :::* LISTEN 729/nginx -g daemon
tcp6 0 0 :::4369 :::* LISTEN 743/epmd
tcp6 0 0 :::22 :::* LISTEN 630/sshd
tcp6 0 0 :::25 :::* LISTEN 1132/[postal] smtp.
tcp6 0 0 :::5672 :::* LISTEN 928/beam
user www-data;
worker_processes auto;
pid /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;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# 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/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
web:
# Хост, на котором будет доступен интерфейс управления
host: postal.office-reklama.ru
# ротокол, который запрашивает интерфейс управления, должен происходить на
protocol: https
fast_server:
# This can be enabled to enable click & open tracking on emails. It is disabled by
# default as it requires a separate static IP address on your server.
enabled: false
bind_address:
general:
# This can be changed to allow messages to be sent from multiple IP addresses
use_ip_pools: false
main_db:
# Specify the connection details for your MySQL database
host: 127.0.0.1
username: postal
password: **********
database: postal
message_db:
# Specify the connection details for your MySQL server that will be house the
# message databases for mail servers.
host: 127.0.0.1
username: postal
password: **************
prefix: postal
rabbitmq:
# Specify the connection details for your RabbitMQ server.
host: 127.0.0.1
username: postal
password: **************
vhost: /postal
ns:
# Specifies the DNS record that you have configured. Refer to the documentation at
# https://github.com/atech/postal/wiki/Domains-&-DNS-Configuration for further
# information about these.
mx_records:
- mx.postal.example.com
smtp_server_hostname: postal.example.com
spf_include: spf.postal.example.com
return_path: rp.postal.example.com
route_domain: routes.postal.example.com
track_domain: track.postal.example.com
smtp:
# Specify an SMTP server that can be used to send messages from the Postal management
# system to users. You can configure this to use a Postal mail server once the
# your installation has been set up.
host: 127.0.0.1
port: 2525
username: # Complete when Postal is running and you can
password: # generate the credentials within the interface.
from_name: Postal
from_address: postal@yourdomain.com
rails:
# This is generated automatically by the config initialization. It should be a random
# string unique to your installation.
secret_key: 9ca7f25bfb9eb187ac944ceef4fdddc566471b663417dfbf1324064ddbd2860928d54cf87da474aac1044fe5cb5bcd1881cd04ca05def3d8d428a4efae7ae231fedf5d25f0e44f726bd74674781c317b16c22ca635724f09da6ecdca1f60ed2675246415f76342d630cd9a5a88421ec848236200bd28c32a306848cfa7268161
# These are the default configuration options that will be used if they aren't overriden
# in your postal.yml configuration file. No changes should be made to this file for
# your installation.
# You can refer to this for a complete listing all available configuration options.
web:
host: postal.office-reklama.ru
protocol: https
general:
use_ip_pools: false
exception_url:
maximum_delivery_attempts: 18
maximum_hold_expiry_days: 7
use_local_ns_for_domains: false
web_server:
bind_address: 127.0.0.1
port: 5000
max_threads: 5
fast_server:
enabled: false
bind_address:
# Set appropriate IP addresses to listen on. These should be dedicated IP
# addresses just used for this server. You should list IPv4 and IPv6 addresses
# as appropriate.
# - 1.2.3.4
# - abcd:a:b:c:d::1
port: 80
ssl_port: 443
proxy_protocol: false
default_private_key_path: # Defaults to config/fast_server.key
default_tls_certificate_path: # Defaults to config/fast_server.cert
main_db:
host: 127.0.0.1
port: 3306
username: postal
password:
database: postal
pool_size: 5
logging:
stdout: false
root: # Automatically determined based on config root
max_log_file_size: 20
max_log_files: 10
greylog:
host:
port: 12201
message_db:
host: 127.0.0.1
port: 3306
username: postal
password:
prefix: postal
rabbitmq:
host: 127.0.0.1
port: 5672
username: postal
password:
vhost: /postal
workers:
quantity: 1
threads: 4
smtp_server:
port: 25
tls_enabled: false
tls_certificate_path: # Defaults to config/smtp.cert
tls_private_key_path: # Defaults to config/smtp.key
tls_ciphers:
ssl_version: SSLv23
proxy_protocol: false
log_connect: true
strip_received_headers: false
max_message_size: 14 # size in Megabytes
smtp_relays:
-
hostname:
port: 25
ssl_mode: Auto
dns:
mx_records:
- mx.postal.office-reklama.ru
smtp_server_hostname: postal.office-reklama.ru
spf_include: spf.postal.example.com
return_path: rp.postal.office-reklama.ru
route_domain: routes.mail.office-reklama.ru
track_domain: track.mail.office-reklama.ru
helo_hostname: # By default, this will be the same as the `smtp_server_hostname`
dkim_identifier: postal
domain_verify_prefix: postal-verification
custom_return_path_prefix: psrp
smtp:
host: 127.0.0.1
port: 25
username: # Complete when Postal is running and you can
password: # generate the credentials within the interface.
from_name: Postal
from_address: postal@yourdomain.com
rails:
environment: production
secret_key:
spamd:
enabled: false
host: 127.0.0.1
port: 783
clamav:
enabled: false
host: 127.0.0.1
port: 2000
smtp_client:
open_timeout: 30
read_timeout: 60