This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
сервис_http [2022/07/16 19:50] val [Управление кодировкой] |
сервис_http [2022/09/26 06:09] val [NGINX] |
||
---|---|---|---|
Line 865: | Line 865: | ||
# service nginx configtest | # service nginx configtest | ||
- | |||
# tail /var/log/nginx/error.log | # tail /var/log/nginx/error.log | ||
+ | |||
+ | или | ||
+ | |||
+ | # nginx -t -c /etc/nginx/nginx.conf | ||
+ | |||
# service nginx restart | # service nginx restart | ||
Line 889: | Line 893: | ||
</code><code> | </code><code> | ||
# ln -s /etc/nginx/sites-available/myapp1 /etc/nginx/sites-enabled/myapp1 | # ln -s /etc/nginx/sites-available/myapp1 /etc/nginx/sites-enabled/myapp1 | ||
+ | </code><code> | ||
+ | # host mail | ||
+ | mail.corpX.un is an alias for server.corpX.un. | ||
+ | server.corpX.un has address 192.168.X.10 | ||
+ | |||
+ | # host webd | ||
+ | webd.corpX.un has address 192.168.X.10 | ||
+ | |||
+ | root@server# cat /var/opt/gitlab/nginx/conf/my.conf | ||
+ | </code><code> | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name webd.corpX.un; | ||
+ | |||
+ | location / { | ||
+ | proxy_pass http://192.168.49.2:30111/; | ||
+ | } | ||
+ | } | ||
+ | server { | ||
+ | listen 80; | ||
+ | server_name mail.corpX.un; | ||
+ | |||
+ | location / { | ||
+ | proxy_pass http://server.corpX.un:81/mail/; | ||
+ | } | ||
+ | } | ||
+ | </code><code> | ||
+ | root@server# cat /var/opt/gitlab/nginx/conf/nginx.conf | ||
+ | </code><code> | ||
+ | ... | ||
+ | include /var/opt/gitlab/nginx/conf/my.conf; | ||
+ | } | ||
+ | </code><code> | ||
+ | root@server# /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx -t | ||
+ | </code><code> | ||
+ | root@server# gitlab-ctl restart nginx | ||
</code> | </code> |