I’m trying to deploy our Angular version 9 code into NGINX_buildpack which is running on Pivotal Cloud Foundry from Jenkins Pipeline. But I’m getting a strange error which is not pointing to any specific line in nginx.conf file. Below is the error that’s displaying in App Manager :
[31;1mERROR[0m Could not validate nginx.conf: exit status 1 [ERR] Failed to compile droplet: Failed to run all supply scripts: exit status 14 [OUT] Exit status 223Any support on how to fix this issue would really help me a lot…!!
nginx.conf file
worker_processes 1;
daemon off;
error_log stderr;
events {
worker_connections 1024;
}
http {
charset utf-8;
sendfile on;
types {
module js;
}
include mime.types;
tcp_nopush on;
keepalive_timeout 30;
port_in_redirect off;
server {
listen {{port}};
root .;
index index.html;
gzip on;
gzip_types *;
add_header Access-Control-Allow-Headers "Authorization";
location / {
try_files $uri $uri/ /index.html;
}
location /<url>/ {
proxy_pass {{env "<path>"}};
}
location /nginx-health {
access_log off;
default_type text/plain;
return 200 "healthyn";
}
}
}
2
Answers
Actually I had given wrong outputPath in angular.json file. I had mentioned the build outputPath as dist/ and then I was trying to deploy only dist to PCF server. Which didn't have the nginx conf at that folder level.
we are facing the same issue(we are using jenkins with UCD). i believe this has nothing to do with nginx.conf syntax, its something to do with the path where you should be copying nginx.conf to. try setting the path variable in your manifest to the folder you are generating your build or the folder you are copying your static build files to as part of your jenkins shell script file.