Angular 15 unexpected "}" in /etc/nginx/nginx.conf:10?
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 3.5k
- Forks
- 1.8k
- Avg merge
- 42m
- Merged PRs (30d)
- 2
Description
Describe the bug
I have deployed angular file with docker and nginx file but from harness pipeline CI done but CD got issue and in the CD i have added my nginx file as well as error image can anybody help on that regarding that issue i am stuck this issue last 4 days can you help me please ?
Docker file
`FROM artifactorycloud.ual.com/v-docker/node:16-alpine3.16 as build
WORKDIR /usr/src/app
ENV PATH /app/node_modules/.bin:$PATH
COPY package*.json ./
RUN npm install -g @angular/cli@15.2.10
RUN echo $WORKDIR
COPY . .
RUN npm run build
RUN ls -ltr /usr/src/app/dist/isa
FROM nginx:alpine
COPY ./config/nginx.conf /etc/nginx/nginx.conf
WORKDIR /usr/share/nginx/html
COPY --from=build /usr/src/app/dist/isa/ .
EXPOSE 4200`
To reproduce
Steps to reproduce the behaviour:
worker_processes auto;
events {
worker_connections 1024;
}
http {
server {
listen 0.0.0.0:80;
listen [::]:80;
default_type application/octet-stream;
# Gzip Settings
gzip on;
gzip_comp_level 6;
gzip_vary on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
client_max_body_size 256M;
# Brotli Settings
# brotli on;
# brotli_comp_level 4;
# brotli_buffers 32 8k;
# brotli_min_length 100;
# brotli_static on;
# brotli_types image/jpeg image/bmp image/svg+xml text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon;
root /usr/share/nginx/html;
#added for security issues
server_tokens off;
location / {
#added for security issues
proxy_pass_header Server;
try_files $uri $uri/ /index.html =
}
}
}
Expected behavior
Fix above error and deploy build
Additional context
Anybody can you help me regarding this issue please let me know?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect config/nginx.conf alongside the reported /etc/nginx/nginx.conf:10 error. Run NGINX's configuration test in the built image, then verify that the container starts and the Angular deployment completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, docker, nginx
- Domain
- devops, infrastructure, web-dev
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100