Unduplicating prox_pass in nginx location blocks
You may move proxy settings to 'server' block. But proxy_pass should stay at 'location' block

upstream foo {
    server 127.0.0.1:8080;
}

server{
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    location /admin {
        allow 123.90.250.0/24;
        allow 123.66.148.0/24;
        proxy_pass http://foo;
    }

    location / {
        proxy_pass http://foo;
    }
}