nginx в качестве прокси для apache и jenkins

Я использую Ubuntu 19.04, и я бы использовал Nginx (на localhost: 80) в качестве прокси (обратный?) Для Apache2 (на localhost: 8080) и Jenkins (at localhost: 8000).

Вопрос: почему все изображения не загружаются?

Мои конфигурации:

/ etc / apache2 / sites-available / 000-default .conf

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/apache2
    DirectoryIndex index.html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

/etc/apache2/sites-available/apache2.localhost.conf

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/apache2.localhost/www
    DirectoryIndex index.html
    ServerName apache2.localhost

    ErrorLog /var/www/html/apache2.localhost/log/error.log
    CustomLog /var/www/html/apache2.localhost/log/access.log combined
</VirtualHost>

/ etc / nginx / sites-available / default

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html/nginx;
    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location /apache2/ {
        proxy_buffering off;
        proxy_pass http://apache2.localhost:8080/;
    }

    location /jenkins/ {
        proxy_buffering off;
        proxy_pass http://localhost:8000/;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}
0
задан 16 August 2019 в 12:23
1 ответ

Я частично решил проблему с этим руководством о jenkins:

https://wiki. jenkins.io/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy

Это мой конфигурационный файл (/etc/nginx/sites-available/default):

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    location /jenkins/ {
        proxy_pass http://127.0.0.1:8000/jenkins/;
        sendfile off;

        proxy_set_header   Host             $host:$server_port;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_max_temp_file_size 0;

        # This is the maximum upload size
        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_temp_file_write_size 64k;

        # Required for new HTTP-based CLI
        proxy_http_version 1.1;
        proxy_request_buffering off;
        proxy_buffering off; # Required for HTTP-based CLI to work over SSL
    }

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
}

Я опубликую полное решение как можно быстрее

.
0
ответ дан 5 December 2019 в 01:26

Теги

Похожие вопросы