Where exactly should I put static asset cache control header codes in my nginx configuration?

I want to add the following cache control header codes in nginx configuration.

location ~* .(png|jpg|jpeg|gif)$ {
    expires 365d;
    add_header Cache-Control "public, no-transform";
}

location ~* .(js|css|pdf|html|swf)$ {
    expires 30d;
    add_header Cache-Control "public, no-transform";
}

I basically want to do this to eliminate the Google page speed warning: “Serve static assets with an efficient cache policy”

I would be extremely grateful if someone can tell me exactly where should I add the above codes in my existing nginx configuration?

My existing nginx configuration is as given below:

[root@serverl ~]# cat /etc/nginx/conf.d/users/homemadecircuits.conf proxy_cache_path
/var/cache/ea-nginx/proxy/homemadecircuits levels=1
:2 keys_zone=homemadecircuits:10m inactive=60m;
#### main domain for homemadecircuits ##
server {
server name homemade-circuits.com www.homemade-circuits.com mail .homemade-circuits.com 203.161.38.9;

listen 80;
listen [::]:80;
access_log /var/log/nginx/domains/homemade-circuits.com cp_combined;
access log /var/log/nginx/domains/homemade-circuits.com-bytes log cp_bytes_server;

include conf.d/includes-optional/cloudflare.conf;
set $CPANEL APACHE PROXY PASS $scheme://apache backend ${scheme} 203 161 38 9;

# For includes:
set $CPANEL APACHE PROXY IP 203.161.38.9;
set $CPANEL APACHE PROXY SSL IP 203.161.38.9;
set $CPANEL SERVICE SUBDOMAIN 0;

set $CPANEL PROXY CACHE homemadecircuits;
set $CPANEL SKIP PROXY CACHING 0;

listen 443 ssl;
listen [::]:443 ssl;

http2 on;

ssl certificate /var/cpanel/ssl/apache tls/homemade-circuits.com /combined;
ssl_protocols TLSv1.2 TLSv1.3; proxy_ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-S
HA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDH
E-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305: DHE-RSA-AES128 -GCM-SHA256:DHE-RSA-AES256-GCM-SHA384: TLS AES 256 GCM SHA384:TLS CHA CHA20 POLY1305 SHA256: TLS AES 128 GCM SHA256;
proxy_ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128
-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA38
4:ECDHE-ECDSA-CHACHA20-POLY1305: ECDHE-RSA-CHACHA20-POLY1305: DHE-RSA- AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384: TLS AES 256 GCM SHA384:T
LS CHACHA20 POLY1305 SHA256: TLS AES 128 GCM SHA256;

root "/home/homemadecircuits/public_html";

location /cpanelwebcall {
include conf.d/includes-optional/cpanel-proxy.conf; 

proxy_pass http://127.0.0.1:2082/cpanelwebcall;
}

location /Microsoft-Server-ActiveSync{
include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass http://127.0.0.1:2090/Microsoft-Server-ActiveSync;
}

location = /favicon.ico {
allow all;
log_not_found off;
access log off;
include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass $CPANEL_APACHE PROXY PASS;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass $CPANEL APACHE_PROXY PASS;
}

location / {
proxy_cache $CPANEL PROXY CACHE;
proxy_no_cache $CPANEL_SKIP_PROXY_CACHING;
proxy_cache_bypass $CPANEL_SKIP_PROXY_CACHING;

proxy_cache_valid 200 301 302 60m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale error timeout http_429 http_500_http_5 02 http_503 http_504;
}
proxy_cache_background_update on;
proxy_cache_revalidate on;
proxy_cache_min uses 1;
proxy_cache_lock off;
add_header X-Cache $upstream_cache_status;

include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass $CPANEL APACHE PROXY PASS;
}

include conf.d/server-includes/*.conf;
include conf.d/users/homemadecircuits/*.conf;
include conf.d/users/homemadecircuits/homemade-circuits.com/*.conf
}

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

listen 443 ssl;
listen [::]:443 ssl;

http2 on;

ssl_certificate /var/cpanel/ssl/apache_tls/homemade-circuits.com
/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/homemade-circuits
.com/combined;

server_name cpanel.homemade-circuits.com cpcalendars.homemade-c ircuits.com cpcontacts.homemade-circuits.com webdisk.homemade-circui ts.com webmail.homemade-circuits.com;

include conf.d/includes-optional/cloudflare.conf;

set $CPANEL APACHE_PROXY_PASS $scheme://apache_backend_${scheme } 203 161 38 9;

# For includes:
set $CPANEL APACHE PROXY IP 203.161.38.9;
set $CPANEL APACHE PROXY SSL IP 203.161.38.9;
set $CPANEL SERVICE SUBDOMAIN 1;

location /.well-known/cpanel-dcv {
root "/home/homemadecircuits/public_html"; disable symlinks if_not_owner;

# pass to Apache
include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass $CPANEL_APACHE_PROXY PASS;
}

location /.well-known/pki-validation { root "/home/homemadecircuits/public_html"; disable_symlinks if_not_owner;

# pass to Apache
include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass $CPANEL APACHE PROXY PASS;
}

location /.well-known/acme-challenge { 
root "/home/homemadecircuits/public_html"; disable_symlinks if_not_owner;

# pass to Apache
include conf.d/includes-optional/cpanel-proxy.conf;

proxy_pass $CPANEL APACHE PROXY PASS;
}

location / {

# Force https for service subdomains
if ($scheme = http) {
return 301 https://$host$request_uri;
}

# no cache
proxy_cache off;
proxy_no_cache 1;
proxy_cache_bypass 1;

# pass to Apache
include conf.d/includes-optional/cpanel-proxy.conf; proxy_pass $CPANEL APACHE PROXY PASS;

I want to add browser caching code in my nginx configuration so that I can eliminate the google page speed warning: “Serve static assets with an efficient cache policy”

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật